From f0a2747ab50b9b0b944655c43ae230ccfb7db1f8 Mon Sep 17 00:00:00 2001 From: Fredrik Bergroth Date: Thu, 13 Dec 2018 13:03:42 +0100 Subject: [PATCH] Adjust active param highlighting in first line of signature (3/3) Highlight only first active parameter match (even if there are many) Copyright-paperwork-exempt: yes * eglot.el (eglot--sig-info): Simplify. --- lisp/progmodes/eglot.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index ae18493f11c..01f6960047f 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1962,13 +1962,10 @@ is not active." (goto-char params-start) (let ((regex (concat "\\<" (regexp-quote label) "\\>")) (case-fold-search nil)) - (cl-loop for nmatches from 0 - while (re-search-forward regex params-end t) - finally do - (when (= 1 nmatches) - (add-face-text-property - (- (point) (length label)) (point) - 'eldoc-highlight-function-argument)))) + (when (re-search-forward regex params-end t) + (add-face-text-property + (- (point) (length label)) (point) + 'eldoc-highlight-function-argument))) (when documentation (goto-char (point-max)) (insert "\n" -- 2.39.2