branch: elpa/evil-emacs-cursor-model-mode
commit c9cc65a58775086c64a9d081991afd2ad821df8c
Author: maxfriis <[email protected]>
Commit: GitHub <[email protected]>

    Fixed zero count input to "to" and "find"
    
    They used to take "steps".
    Also changed from (if... to (cond...
---
 evil-emacs-cursor-model-mode.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/evil-emacs-cursor-model-mode.el b/evil-emacs-cursor-model-mode.el
index 009957fb41..e9f62ba58c 100644
--- a/evil-emacs-cursor-model-mode.el
+++ b/evil-emacs-cursor-model-mode.el
@@ -149,12 +149,13 @@ Movement is restricted to the current line unless 
`evil-cross-lines' is non-nil.
   :type inclusive
   (interactive "<c><C>")
   (unless count (setq count 1))
-  (if (< count 0)
-      (evil-find-char-backward-to (- count) char)
-    ;; else
+  (cond
+   ((> count 0)
     (when (= (char-after) char)
       (cl-decf count))
     (evil-find-char count char))
+   ((< count 0)
+    (evil-find-char-to-backward (- count) char)))
   (setq evil-last-find (list #'evil-emacs-cursor-model-find-before-char char 
(> count 0))))
 
 (evil-define-motion evil-emacs-cursor-model-find-after-char (count char)
@@ -163,13 +164,14 @@ Movement is restricted to the current line unless 
`evil-cross-lines' is non-nil.
   :type inclusive
   (interactive "<c><C>")
   (unless count (setq count 1))
-  (if (< count 0)
-      (evil-find-char-backward (- count) char)
-    ;; else
+  (cond
+   ((> count 0)
     (when (= (char-after) char)
       (cl-decf count))
     (evil-find-char count char)
     (forward-char))
+   ((< count 0)
+    (evil-find-char-backward (- count) char)))
   (setq evil-last-find (list #'evil-emacs-cursor-model-find-after-char char (> 
count 0))))
 
 (defun evil-emacs-cursor-model-forward-after-end (thing &optional count)

Reply via email to