emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/evil-goggles 1ffd97d6b8 102/225: add support for evil-nerd


From: ELPA Syncer
Subject: [nongnu] elpa/evil-goggles 1ffd97d6b8 102/225: add support for evil-nerd-commenter
Date: Wed, 12 Jan 2022 08:59:00 -0500 (EST)

branch: elpa/evil-goggles
commit 1ffd97d6b89f1e2efa00c644ddcc342482b31e2f
Author: Dickby <felix.dick@web.de>
Commit: Evgeni Kolev <evgenysw@gmail.com>

    add support for evil-nerd-commenter
---
 README.md       | 2 +-
 evil-goggles.el | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 9988c4fb2f..18b76019f1 100644
--- a/README.md
+++ b/README.md
@@ -66,7 +66,7 @@ evil-goggles
 #### evil plugins with hint
 
 - surround [evil-surround](https://github.com/timcharper/evil-surround)
-- commentary [evil-commentary](https://github.com/linktohack/evil-commentary)
+- comment [evil-commentary](https://github.com/linktohack/evil-commentary) and 
[evil-nerd-commenter](https://github.com/redguardtoo/evil-nerd-commenter)
 - replace with register 
[evil-ReplaceWithRegister](https://github.com/Dewdrops/evil-ReplaceWithRegister)
 
 ## Customizations
diff --git a/evil-goggles.el b/evil-goggles.el
index 4d255cf000..e05cbcb3a2 100644
--- a/evil-goggles.el
+++ b/evil-goggles.el
@@ -594,7 +594,11 @@ COUNT BEG &OPTIONAL END TYPE REGISTER are the arguments of 
the original function
       (advice-add 'evil-surround-region :around 
'evil-goggles--evil-surround-region-advice))
 
     (when evil-goggles-enable-commentary
-      (advice-add 'evil-commentary :around 
'evil-goggles--evil-commentary-advice))
+      (cond
+       ((fboundp 'evil-commentary)
+       (advice-add 'evil-commentary :around 
'evil-goggles--evil-commentary-advice))
+       ((fboundp 'evilnc-comment-operator)
+       (advice-add 'evilnc-comment-operator :around 
'evil-goggles--evil-commentary-advice))))
 
     (when evil-goggles-enable-replace-with-register
       (advice-add 'evil-replace-with-register :around 
'evil-goggles--evil-replace-with-register-advice)))
@@ -618,6 +622,7 @@ COUNT BEG &OPTIONAL END TYPE REGISTER are the arguments of 
the original function
     ;; evil non-core functions
     (advice-remove 'evil-surround-region 
'evil-goggles--evil-surround-region-advice)
     (advice-remove 'evil-commentary 'evil-goggles--evil-commentary-advice)
+    (advice-remove 'evilnc-comment-operator 
'evil-goggles--evil-commentary-advice)
     (advice-remove 'evil-replace-with-register 
'evil-goggles--evil-replace-with-register-advice))))
 
 (provide 'evil-goggles)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]