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

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

[nongnu] elpa/evil-matchit b63f840ee7 124/244: When on whitespace follow


From: ELPA Syncer
Subject: [nongnu] elpa/evil-matchit b63f840ee7 124/244: When on whitespace following a keyword don't jump backwards
Date: Thu, 6 Jan 2022 02:58:55 -0500 (EST)

branch: elpa/evil-matchit
commit b63f840ee7637dc0d05ae6c31a4d2a728ba399af
Author: Tomasz KoƂodziejski <tkolodziejski@gmail.com>
Commit: Tomasz KoƂodziejski <tkolodziejski@gmail.com>

    When on whitespace following a keyword don't jump backwards
    
    In the example:
    
    ```
    module Stable = struct
     | let x = 1
    end
    ```
    
    don't jump to end if the point is in the place marked with `|`.
---
 evil-matchit-ocaml.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/evil-matchit-ocaml.el b/evil-matchit-ocaml.el
index 3c2af0577f..53cff0d482 100644
--- a/evil-matchit-ocaml.el
+++ b/evil-matchit-ocaml.el
@@ -61,9 +61,8 @@
       nil)))
 
 (defun evilmi-ocaml-goto-word-beginning ()
-  ;; this is so that when the cursor is on the first character we don't jump 
to previous word
-  (forward-char)
-  (search-backward-regexp "\\<"))
+  (let ((bounds (bounds-of-thing-at-point 'word)))
+    (if bounds (goto-char (car bounds)))))
 
 ;;;###autoload
 (defun evilmi-ocaml-get-tag ()



reply via email to

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