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

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

[nongnu] elpa/evil-matchit b75893af9e 028/244: minor bug in latex-mode


From: ELPA Syncer
Subject: [nongnu] elpa/evil-matchit b75893af9e 028/244: minor bug in latex-mode
Date: Thu, 6 Jan 2022 02:58:46 -0500 (EST)

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

    minor bug in latex-mode
---
 evil-matchit-latex.el | 29 +++++++++++++++++++----------
 1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/evil-matchit-latex.el b/evil-matchit-latex.el
index 0fa555fa24..fdfc6b496f 100644
--- a/evil-matchit-latex.el
+++ b/evil-matchit-latex.el
@@ -34,7 +34,6 @@
   (let (rlt
         (regexp (concat (regexp-quote "\\") "\\(begin\\|end\\)\\b"))
         keyword
-        p
         )
     (skip-chars-backward "a-zA-Z \t{}")
     ;; move cursor to the beginning of tag
@@ -43,14 +42,15 @@
       )
     (re-search-forward regexp (line-end-position) t)
     (setq keyword (match-string 1))
-    (setq rlt (list p
-                    (if (string= keyword "begin")
-                        0
-                      (if (string= keyword "end")
-                          1
-                        -1))
-                    )
+    (if keyword
+        (cond
+         ((string= keyword "begin")
+          (setq rlt (list (line-beginning-position) 0))
           )
+         ((string= keyword "end")
+          (setq rlt (list (line-end-position) 2))
+          )
+         ))
     rlt
     )
   )
@@ -59,9 +59,18 @@
 (defun evilmi-latex-jump (rlt NUM)
   (let ((p (nth 0 rlt))
         (tag-type (nth 1 rlt))
+        where-to-jump-in-theory
         )
-    (if (=  1 tag-type) (LaTeX-find-matching-begin))
-    (if (=  0 tag-type) (LaTeX-find-matching-end))
+    (cond
+     ((=  2 tag-type)
+      (LaTeX-find-matching-begin)
+      (setq where-to-jump-in-theory (line-beginning-position))
+      )
+     ((=  0 tag-type)
+      (LaTeX-find-matching-end)
+      (setq where-to-jump-in-theory (line-end-position))
+      )
+     )
     )
   )
 



reply via email to

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