branch: elpa/evil-matchit
commit b63f840ee7637dc0d05ae6c31a4d2a728ba399af
Author: Tomasz KoƂodziejski <[email protected]>
Commit: Tomasz KoƂodziejski <[email protected]>

    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