From 8e39ae3c625fd79eca0dc2a019c8f8f21ee5f8fd Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Tue, 2 May 2023 18:23:57 +0200 Subject: [PATCH] Before adding a permanent overlay, remove temporary overlay Otherwise both overlays remain in effect until the user moves away from the current symbol. --- symbol-overlay.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/symbol-overlay.el b/symbol-overlay.el index 3bead7d..252633b 100644 --- a/symbol-overlay.el +++ b/symbol-overlay.el @@ -385,6 +385,8 @@ Otherwise apply `symbol-overlay-default-face'." The face is randomly picked from `symbol-overlay-faces'. If SCOPE is non-nil, put overlays only on occurrences in scope. If KEYWORD is non-nil, remove it then use its color on new overlays." + (when symbol-overlay-temp-symbol + (symbol-overlay-remove-temp)) (let* ((case-fold-search nil) (limit (length symbol-overlay-faces)) (face (or (symbol-overlay-maybe-remove keyword)