Skip to content

Commit

Permalink
feat: Prevent redisplay error 1
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jul 3, 2024
1 parent bdfb001 commit 1f2bc32
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions undo-tree-vf.el
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
(defun undo-tree-vf--kill-visualizer (&rest _)
"Safe version `undo-tree-kill-visualizer'."
(when (undo-tree-vs--enabled-p)
(undo-tree-kill-visualizer)))
(ignore-errors (undo-tree-kill-visualizer))))

;;
;; (@* "Util" )
Expand All @@ -96,9 +96,10 @@
(defun undo-tree-vf--window-buffer-change (&rest _)
"Window buffer change."
(when (undo-tree-vs--enabled-p)
(when-let (((not (minibuffer-window-active-p (selected-window))))
(buf (current-buffer))
(win (get-buffer-window undo-tree-visualizer-buffer-name)))
(when-let* (((not (minibuffer-window-active-p (selected-window))))
(buf (current-buffer))
(win (get-buffer-window undo-tree-visualizer-buffer-name))
((window-live-p win)))
(with-selected-window win
(unless (equal buf undo-tree-visualizer-parent-buffer)
(undo-tree-vf--kill-visualizer))))))
Expand Down

0 comments on commit 1f2bc32

Please sign in to comment.