Skip to content

Commit

Permalink
fix: Simplify get window logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed May 26, 2024
1 parent 28e9104 commit 07c07c7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions undo-tree-vf.el
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,10 @@ If `undo-tree-mode' is not valid, we call undo/redo function according to ARG"
(defun undo-tree-vf--visualize ()
"Call `undo-tree-visualize' only in window that has higher height."
(save-window-excursion (undo-tree-visualize))
(when (< (length (window-list)) 2)
(display-buffer undo-tree-visualizer-buffer-name
`((display-buffer-in-direction)
(dedicated . t))))
(with-selected-window (get-largest-window nil t t)
(with-selected-window (or (get-largest-window nil nil t)
(display-buffer undo-tree-visualizer-buffer-name
`((display-buffer-in-direction)
(dedicated . t))))
(switch-to-buffer undo-tree-visualizer-buffer-name)
(undo-tree-vf--recenter-top-bottom)
(fill-page-if-unfill)))
Expand Down

0 comments on commit 07c07c7

Please sign in to comment.