]> git.eshelyaron.com Git - emacs.git/commitdiff
Adjust active param highlighting in first line of signature (2/3)
authorFredrik Bergroth <fbergroth@gmail.com>
Thu, 13 Dec 2018 12:02:15 +0000 (13:02 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sun, 16 Dec 2018 13:52:12 +0000 (13:52 +0000)
Use regex with word boundaries when scanning for active param, to
avoid matching substrings.

Copyright-paperwork-exempt: yes

* eglot.el (eglot--sig-info): Use `re-search-forward`.

lisp/progmodes/eglot.el

index 46cfb595fe51aff6b141fafa6d3ccc57f4af0148..ae18493f11cab8c4f17979193bc37ec921973a87 100644 (file)
@@ -1960,10 +1960,10 @@ is not active."
            (eglot--dbind ((ParameterInformation) label documentation)
                (aref parameters active-param)
              (goto-char params-start)
-             (let ((case-fold-search nil))
+             (let ((regex (concat "\\<" (regexp-quote label) "\\>"))
+                   (case-fold-search nil))
                (cl-loop for nmatches from 0
-                        while (and (not (string-empty-p label))
-                                   (search-forward label params-end t))
+                        while (re-search-forward regex params-end t)
                         finally do
                         (when (= 1 nmatches)
                           (add-face-text-property