mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
refactor(evil): use window-swap-states in +evil--window-swap
Taking a look at the built in windmove functions shows that Emacs has a built in function for swapping windows called `window-swap-states`. Using this ensures the window state is maintained. Ref: #6023 Co-authored-by: luveti <luveti@users.noreply.github.com>
This commit is contained in:
@ -69,10 +69,7 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
|
||||
(with-selected-window that-window
|
||||
(switch-to-buffer (doom-fallback-buffer)))
|
||||
(setq that-buffer (window-buffer that-window)))
|
||||
(with-selected-window this-window
|
||||
(switch-to-buffer that-buffer))
|
||||
(with-selected-window that-window
|
||||
(switch-to-buffer this-buffer))
|
||||
(window-swap-states this-window that-window)
|
||||
(select-window that-window))))
|
||||
|
||||
;;;###autoload
|
||||
|
Reference in New Issue
Block a user