Skip to content

Commit

Permalink
Unhighlight after insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Nov 25, 2021
1 parent 71c9d2d commit bc1564a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions auto-highlight-symbol.el
Expand Up @@ -947,7 +947,7 @@ You can do these operations at One Key!
;; (@* "Timer" )
;;

(defun ahs-start-timer ()
(defun ahs-start-timer (&rest _)
"Start idle timer."
(when auto-highlight-symbol-mode
(ahs-unhighlight) ; unhighlight it once here so we can see the result immediately
Expand Down Expand Up @@ -1554,15 +1554,17 @@ If FORCE is non-nil, delete all in the current buffer."
(unless ahs-current-range
(ahs-change-range-internal ahs-default-range))
(ahs-set-lighter)
(add-hook 'post-command-hook #'ahs-start-timer nil t))
(add-hook 'post-command-hook #'ahs-start-timer nil t)
(add-hook 'after-change-functions #'ahs-start-timer nil t))

(defun ahs-clear (&optional verbose)
"Remove all overlays and exit edit mode."
(if ahs-edit-mode-enable
(ahs-edit-mode-off (not verbose) nil)
(ahs-unhighlight-all t)
(ht-clear ahs-window-map)
(remove-hook 'post-command-hook #'ahs-start-timer t)))
(remove-hook 'post-command-hook #'ahs-start-timer t)
(remove-hook 'after-change-functions #'ahs-start-timer t)))

(defun ahs-mode-maybe ()
"Fire up `auto-highlight-symbol-mode' if major-mode in ahs-modes."
Expand Down

0 comments on commit bc1564a

Please sign in to comment.