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

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

[nongnu] elpa/evil-matchit e137a380ee 148/244: Merge pull request #91 fr


From: ELPA Syncer
Subject: [nongnu] elpa/evil-matchit e137a380ee 148/244: Merge pull request #91 from Khady/ocaml-check-keywords
Date: Thu, 6 Jan 2022 02:58:57 -0500 (EST)

branch: elpa/evil-matchit
commit e137a380ee2e10f41094f1305a11b417ed535fca
Merge: 8123eef094 2001c5be5f
Author: Chen Bin <chenbin.sh@gmail.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #91 from Khady/ocaml-check-keywords
    
    ocaml: improve validation of keywords
---
 evil-matchit-ocaml.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/evil-matchit-ocaml.el b/evil-matchit-ocaml.el
index e04dab6817..6b0549921f 100644
--- a/evil-matchit-ocaml.el
+++ b/evil-matchit-ocaml.el
@@ -49,10 +49,10 @@
   "Build regexp to find next/previous keyword in a row."
   (format "\\<\\(%s\\)\\>" (mapconcat 'identity (apply 'append tag-info) 
"\\|")))
 
-(defun evilmi-ocaml-valid-position-p ()
-  "Check if point is not in comment, string or doc"
-  (not (or (evilmi-in-comment-p (point))
-           (evilmi-in-string-or-doc-p (point)))))
+(defun evilmi-ocaml-in-keyword-p (pos)
+  "Check character at POS is keyword by comparing font face."
+  (evilmi-current-font-among-fonts-p pos '(tuareg-font-lock-governing-face
+                                           font-lock-keyword-face)))
 
 ;; jumps to next keyword. Returs nil if there's no next word
 (defun evilmi-ocaml-next-possible-keyword (direction keywords-regex)
@@ -74,7 +74,7 @@ such keyword is available."
         (keyword-exist-p t))
     (while (and (not found-keyword-p) keyword-exist-p)
       (setq keyword-exist-p (evilmi-ocaml-next-possible-keyword direction 
keywords-regex))
-      (if (and keyword-exist-p (evilmi-ocaml-valid-position-p))
+      (if (and keyword-exist-p (evilmi-ocaml-in-keyword-p (point)))
           (setq found-keyword-p t)))
     found-keyword-p))
 



reply via email to

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