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:
Henrik Lissner 2022-01-27 03:30:24 +01:00
parent b2b19e7196
commit 1d41ee0c1a

View file

@ -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