branch: elpa/evil-nerd-commenter
commit 36304a689bd87af7b8a4a4e904c07b339a6d2f2c
Author: Chen Bin <[email protected]>
Commit: Chen Bin <[email protected]>

    tested in Emacs 24.4
---
 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 e93635fd0a..cbe8d9afcb 100644
--- a/evil-nerd-commenter.el
+++ b/evil-nerd-commenter.el
@@ -197,12 +197,15 @@ See 
http://lists.gnu.org/archive/html/bug-gnu-emacs/2013-03/msg00891.html.";
 
 (defun evilnc--forward-line (num)
   "Move NUM source or screen lines forward, depending on visual-line settings."
-  (if (or (and visual-line-mode
-               (or (not evil-mode)
-                   (bound-and-true-p evil-respect-visual-line-mode)))
-          (eq display-line-numbers-type 'visual))
-      (vertical-motion num)
-    (forward-line num)))
+  (cond
+   ((or (and visual-line-mode
+             (or (not (bound-and-true-p evil-mode))
+                 (bound-and-true-p evil-respect-visual-line-mode)))
+        (and (boundp 'display-line-numbers-type)
+             (eq display-line-numbers-type 'visual)))
+    (vertical-motion num))
+   (t
+    (forward-line num))))
 
 (defun evilnc--operation-on-lines-or-region (fn &optional num)
   "Apply FN on NUM lines or selected region."

Reply via email to