fix(evil): more reliable window detection

At some point `windmove-find-other-window` stopped loading reliably,
such that `SPC w H` would complain of a missing symbol. Indeed
navigating to the implementation of `windmove` within Emacs's Lisp we
find warnings that it has mostly been superceded by newer window APIs
since 2013, and is implemented in terms of `window-in-direction`.

By using `window-in-direction` directly, the loading problem disappears.
This commit is contained in:
Colin Woodbury 2023-09-11 10:03:02 +09:00 committed by Henrik Lissner
parent 46d7404bef
commit 20cdba39a8

View file

@ -48,7 +48,7 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
(user-error "Cannot swap a dedicated window")) (user-error "Cannot swap a dedicated window"))
(let* ((this-window (selected-window)) (let* ((this-window (selected-window))
(this-buffer (current-buffer)) (this-buffer (current-buffer))
(that-window (windmove-find-other-window direction nil this-window)) (that-window (window-in-direction direction nil this-window))
(that-buffer (window-buffer that-window))) (that-buffer (window-buffer that-window)))
(when (or (minibufferp that-buffer) (when (or (minibufferp that-buffer)
(window-dedicated-p this-window)) (window-dedicated-p this-window))