Fix #4770: New window is focused after split

According to the documentation of `evil-window-split` the variable
`evil-split-window-below` needs to be non-nil for the new window to be
created below; and for `evil-window-vsplit` it is the variable
`evil-vsplit-window-right` that needs to be non-nil for the window to be
created on the right.
This commit is contained in:
Benjamin Picardat 2021-03-10 15:48:31 +01:00
parent 4a08acd234
commit e33b21dc46

View file

@ -95,17 +95,17 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
;;;###autoload ;;;###autoload
(defun +evil/window-split-and-follow () (defun +evil/window-split-and-follow ()
"Split current window horizontally, then focus new window. "Split current window horizontally, then focus new window.
If `evil-vsplit-window-right' is non-nil, the new window isn't focused." If `evil-split-window-below' is non-nil, the new window isn't focused."
(interactive) (interactive)
(let ((evil-vsplit-window-right (not evil-vsplit-window-right))) (let ((evil-split-window-below (not evil-split-window-below)))
(call-interactively #'evil-window-split))) (call-interactively #'evil-window-split)))
;;;###autoload ;;;###autoload
(defun +evil/window-vsplit-and-follow () (defun +evil/window-vsplit-and-follow ()
"Split current window vertically, then focus new window. "Split current window vertically, then focus new window.
If `evil-split-window-below' is non-nil, the new window isn't focused." If `evil-vsplit-window-right' is non-nil, the new window isn't focused."
(interactive) (interactive)
(let ((evil-split-window-below (not evil-split-window-below))) (let ((evil-vsplit-window-right (not evil-vsplit-window-right)))
(call-interactively #'evil-window-vsplit))) (call-interactively #'evil-window-vsplit)))
;;;###autoload (autoload '+evil:apply-macro "editor/evil/autoload/evil" nil t) ;;;###autoload (autoload '+evil:apply-macro "editor/evil/autoload/evil" nil t)