branch: elpa/evil-nerd-commenter
commit 9c43de8b19625f5bdc9130810c3ceaa3c8e7fde4
Merge: adb8ba60de 9450c91c71
Author: chen bin <[email protected]>
Commit: chen bin <[email protected]>
Merge pull request #22 from chrueg/master
Bufgix in evilnc--in-comment-p
---
evil-nerd-commenter.el | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/evil-nerd-commenter.el b/evil-nerd-commenter.el
index ae59aa829b..d9ab951596 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -146,12 +146,15 @@
(defun evilnc--in-comment-p (pos)
(interactive)
- (let ((fontface (get-text-property pos 'face)))
- ;; learn this trick from flyspell
- (or (string= fontface 'font-lock-comment-face)
- (string= fontface 'font-lock-comment-delimiter-face)
- )
- ))
+ (let ((fontfaces (get-text-property pos 'face)))
+ (when (not (listp fontfaces))
+ (setf fontfaces (list fontfaces)))
+ (delq nil
+ (mapcar #'(lambda (f)
+ ;; learn this trick from flyspell
+ (or (string= f 'font-lock-comment-face)
+ (string= f 'font-lock-comment-delimiter-face)))
+ fontfaces))))
;; @return (list beg end)
(defun evilnc--extend-to-whole-comment (beg end)