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

    Fixed it so "t" with negative count equals "T"
    
    f/t with negative count works like F/T but F/T with negative count has 
evil-mode behavior.
    F/T with negative count is so unusual that I don't rebind them.
---
 evil-emacs-cursor-model-mode.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/evil-emacs-cursor-model-mode.el b/evil-emacs-cursor-model-mode.el
index 27a4bcaa90..8366c7c814 100644
--- a/evil-emacs-cursor-model-mode.el
+++ b/evil-emacs-cursor-model-mode.el
@@ -160,13 +160,15 @@ Maybe fewer layers are better if you have an Emacs pinky?"
 ;; ============================================================================
 ;;; Evil commands implementing the cursor model
 ;; ============================================================================
+;; f/t with -count works like F/T. F/T with -count has evil-mode behavior.
+;; F/T with negative count is so unusual that I don't rebind them.
 (evil-define-motion evil-emacs-cursor-model-find-after-char (count char)
   "Move point immediately after the next COUNT'th occurrence of CHAR.
 Movement is restricted to the current line unless `evil-cross-lines' is 
non-nil."
   :type inclusive
   (interactive "<c><C>")
   (setq count (or count 1))
-  (if (and (= char (char-after)) (plusp count))
+  (if (and (plusp count) (= char (char-after)))
       (evil-find-char (1- count) char)
     (evil-find-char count char))
   (when (plusp count) (forward-char)))
@@ -177,8 +179,9 @@ Movement is restricted to the current line unless 
`evil-cross-lines' is non-nil.
   :type inclusive
   (interactive "<c><C>")
   (setq count (or count 1))
-  (if (and (= char (char-after)) (plusp count))
+  (if (and (plusp count) (= char (char-after)))
       (evil-find-char (1- count) char)
+    (when (and (minusp count) (= char (char-before))) (incf count))
     (evil-find-char count char))
   (when (minusp count) (forward-char))
   (setq evil-last-find (list #'evil-find-char-to char (plusp count))))

Reply via email to