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

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

[nongnu] elpa/evil-numbers cdfb3cb83c 017/145: Cursor position adjustmen


From: ELPA Syncer
Subject: [nongnu] elpa/evil-numbers cdfb3cb83c 017/145: Cursor position adjustment after inc/dec
Date: Thu, 6 Jan 2022 03:00:15 -0500 (EST)

branch: elpa/evil-numbers
commit cdfb3cb83cbb507403cb44fd0225b8fe4f41fcfd
Author: York Zhao <gtdplatform@gmail.com>
Commit: Michael Markert <markert.michael@googlemail.com>

    Cursor position adjustment after inc/dec
    
    Moves point one position back after inc/dec to conform with the behavior in 
Vim.
---
 evil-numbers.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/evil-numbers.el b/evil-numbers.el
index ebba8cbb5d..342ffe3641 100644
--- a/evil-numbers.el
+++ b/evil-numbers.el
@@ -67,6 +67,8 @@
            (replace-match
             (format (format "%%0%dd" (- (match-end 1) (match-beginning 1)))
                     (+ amount (string-to-number (match-string 0) 10))))
+                  ;; Moves point one position back to conform with Vim
+                  (forward-char -1)
            t))
        (error "No number at point or until end of line")))))
 
@@ -116,6 +118,8 @@ decimal: [0-9]+, e.g. 42 or 23"
     (replace-match (evil-numbers/format (+ inc (string-to-number (match-string 
1) base))
                                         (length (match-string 1))
                                         base))
+       ;; Moves point one position back to conform with Vim
+       (forward-char -1)
     t))
 
 (defun evil-numbers/format (num width base)



reply via email to

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