]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove highlight overlays immediately when symbol edited
authorAugusto Stoffel <arstoffel@gmail.com>
Thu, 25 Feb 2021 14:48:41 +0000 (15:48 +0100)
committerJoão Távora <joaotavora@gmail.com>
Sat, 6 Mar 2021 20:55:57 +0000 (20:55 +0000)
* eglot.el (eglot--highlight-piggyback): Add modification-hooks
property to the created overlays.

Co-authored-by: João Távora <joaotavora@gmail.com>
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/626

lisp/progmodes/eglot.el

index d4300e186be815cfb477228016f896f7e82f6e42..964658a8b233fdb8c2da81ad15cc1d2b3674ea0f 100644 (file)
@@ -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)