From 8c0b2ca7cf76ec5215029ff0ab15f4bec1b1f12e Mon Sep 17 00:00:00 2001 From: Augusto Stoffel Date: Thu, 25 Feb 2021 15:48:41 +0100 Subject: [PATCH] Remove highlight overlays immediately when symbol edited MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * eglot.el (eglot--highlight-piggyback): Add modification-hooks property to the created overlays. Co-authored-by: João Távora GitHub-reference: fix https://github.com/joaotavora/eglot/issues/626 --- lisp/progmodes/eglot.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index d4300e186be..964658a8b23 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2421,7 +2421,8 @@ is not active." (eglot--range-region range))) (let ((ov (make-overlay beg end))) (overlay-put ov 'face 'eglot-highlight-symbol-face) - (overlay-put ov 'evaporate t) + (overlay-put ov 'modification-hooks + `(,(lambda (o &rest _) (delete-overlay o)))) ov))) highlights)))) :deferred :textDocument/documentHighlight) -- 2.39.2