From: Fredrik Bergroth Date: Thu, 13 Dec 2018 12:02:15 +0000 (+0100) Subject: Adjust active param highlighting in first line of signature (2/3) X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~364 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d050540fefed7547a85be3c9eb2e71581a98724b;p=emacs.git Adjust active param highlighting in first line of signature (2/3) 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`. --- diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 46cfb595fe5..ae18493f11c 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -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