Skip to content

Commit

Permalink
[Peek] Run peek-mode tear down when quitting treemacs.
Browse files Browse the repository at this point in the history
Fixes #1063
  • Loading branch information
Alexander-Miller committed Nov 27, 2023
1 parent fb8980c commit 1778134
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/elisp/treemacs-peek-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ purged."
(run-with-idle-timer 0.5 :repeat #'treemacs--do-peek))
(add-hook
'window-selection-change-functions #'treemacs--finish-peek-on-window-leave
nil :local))
nil :local)
(add-hook 'treemacs-quit-hook #'treemacs--tear-down-peek-mode))

(defun treemacs--tear-down-peek-mode (&optional restore-window)
"Tear down faces, timers.
Expand All @@ -114,7 +115,8 @@ kept."
(-let [(window buffer) treemacs--pre-peek-state]
(with-selected-window window
(switch-to-buffer buffer))))
(setf treemacs--pre-peek-state nil)))
(setf treemacs--pre-peek-state nil))
(remove-hook 'treemacs-quit-hook #'treemacs--tear-down-peek-mode) )

;;;###autoload
(define-minor-mode treemacs-peek-mode
Expand Down

0 comments on commit 1778134

Please sign in to comment.