branch: externals/eglot
commit d77b4475b6429d591fbefe5128ba9a27e97b4b28
Author: Fredrik Bergroth <[email protected]>
Commit: João Távora <[email protected]>
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`.
---
eglot.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/eglot.el b/eglot.el
index 46cfb59..ae18493 100644
--- a/eglot.el
+++ b/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