emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/idle-highlight-mode f6ea983df9 06/59: Remove previous high


From: ELPA Syncer
Subject: [nongnu] elpa/idle-highlight-mode f6ea983df9 06/59: Remove previous highlights if there's nothing to highlight at point.
Date: Thu, 7 Jul 2022 12:00:28 -0400 (EDT)

branch: elpa/idle-highlight-mode
commit f6ea983df969b018fda772ed4ed5fd69347ec81a
Author: Cornelius Mika <cornelius.mika@gmail.com>
Commit: Campbell Barton <ideasman42@gmail.com>

    Remove previous highlights if there's nothing to highlight at point.
---
 idle-highlight-mode.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/idle-highlight-mode.el b/idle-highlight-mode.el
index 04aa810093..f4e19baeb8 100755
--- a/idle-highlight-mode.el
+++ b/idle-highlight-mode.el
@@ -73,14 +73,17 @@
       (
         (target-symbol (symbol-at-point))
         (target (symbol-name target-symbol)))
-      (when
+      (if
         (and
           target-symbol (not (in-string-p))
           ;; TODO: no need to highlight keywords like if
           (not (equal target "end")))
+        (progn
+          (idle-highlight-unhighlight)
+          (setq idle-highlight-regexp (concat "\\<" (regexp-quote target) 
"\\>"))
+          (highlight-regexp idle-highlight-regexp 'idle-highlight))
         (idle-highlight-unhighlight)
-        (setq idle-highlight-regexp (concat "\\<" (regexp-quote target) "\\>"))
-        (highlight-regexp idle-highlight-regexp 'idle-highlight)))))
+        (setq idle-highlight-regexp nil)))))
 
 (defsubst idle-highlight-unhighlight ()
   (if idle-highlight-regexp



reply via email to

[Prev in Thread] Current Thread [Next in Thread]