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

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

[nongnu] elpa/evil-matchit 2b9b68770a 219/244: fixed: cannot jump back f


From: ELPA Syncer
Subject: [nongnu] elpa/evil-matchit 2b9b68770a 219/244: fixed: cannot jump back from the line end in visual mode
Date: Thu, 6 Jan 2022 02:59:03 -0500 (EST)

branch: elpa/evil-matchit
commit 2b9b68770a384672e1fdc02326036a05d3cbaf01
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: Chen Bin <chenbin.sh@gmail.com>

    fixed: cannot jump back from the line end in visual mode
---
 evil-matchit-simple.el | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/evil-matchit-simple.el b/evil-matchit-simple.el
index 090361ac2d..98c0c57dc2 100644
--- a/evil-matchit-simple.el
+++ b/evil-matchit-simple.el
@@ -86,11 +86,31 @@ If it's t, use simple jump.")
         ;; sorry we could not jump between ends of string in python-mode
         (memq ch evilmi-quote-chars)))))
 
+(defun evilmi-simple-following-char ()
+  "Get the character at point or find matching tag start point nearby."
+  (let* ((b (line-beginning-position))
+         (whitespaces '(9 10 13 32))
+         new-pos)
+
+    (save-excursion
+      (let* (ch found)
+        (while (and (setq ch (following-char))
+                    (> (point) b)
+                    (not (setq found (or (memq ch evilmi-backward-chars)
+                                         (memq ch evilmi-forward-chars))))
+                    (memq ch whitespaces))
+          (goto-char (1- (point))))
+        (if found (setq new-pos (point)))))
+
+    (if new-pos (goto-char new-pos))
+
+    (following-char)))
+
 ;;;###autoload
 (defun evilmi-simple-get-tag ()
   "Get current tag in simple language."
   (let* (forward-line-num
-         (ch (following-char))
+         (ch (evilmi-simple-following-char))
          rlt)
 
     (cond



reply via email to

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