From d050540fefed7547a85be3c9eb2e71581a98724b Mon Sep 17 00:00:00 2001 From: Fredrik Bergroth Date: Thu, 13 Dec 2018 13:02:15 +0100 Subject: [PATCH] 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`. --- lisp/progmodes/eglot.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.39.2