refactor!(:term): toggle commands now always hide

BREAKING CHANGE: previously, <leader> o t commands would only hide the
terminal popup if it was focused. If not, they would move the focus to
the terminal window. This is unintuitive to the "toggle" description,
and arguably less useful, since refocusing to the terminal can be easily
done with regular window refocus commands. Therefore, <leader> o t now
just hides the terminal popup.

Fix #3374
This commit is contained in:
Itai Y. Efrat 2021-09-21 14:57:00 +03:00 committed by Henrik Lissner
parent 7274f73500
commit 7933e54542
4 changed files with 9 additions and 29 deletions

View file

@ -26,12 +26,7 @@ Returns the vterm buffer."
(when (window-live-p window)
(delete-window window))))
(if-let (win (get-buffer-window buffer-name))
(if (eq (selected-window) win)
(delete-window win)
(select-window win)
(when (bound-and-true-p evil-local-mode)
(evil-change-to-initial-state))
(goto-char (point-max)))
(delete-window win)
(let ((buffer (get-buffer-create buffer-name)))
(with-current-buffer buffer
(unless (eq major-mode 'vterm-mode)