From: Augusto Stoffel Date: Thu, 25 Feb 2021 14:48:41 +0000 (+0100) Subject: Remove highlight overlays immediately when symbol edited X-Git-Tag: emacs-29.0.90~1616^2~524^2~4^2~156 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8c0b2ca7cf76ec5215029ff0ab15f4bec1b1f12e;p=emacs.git Remove highlight overlays immediately when symbol edited * 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 --- 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)