syntax-checking: prevent changing window when quitting error list

When toggling off flycheck's error list window, it calls `quit-window` which
might also change the focus to another window.

Wrapping this form `save-selected-window` ensures the focus always returns to
where toggling command is first invoked.
This commit is contained in:
Lucius Hu 2022-07-13 17:39:40 -04:00
parent 99933b1fb3
commit 4636672203
No known key found for this signature in database
GPG key ID: 7E474E82E29B5A7A

View file

@ -34,8 +34,8 @@ true."
"Toggle flycheck's error list window.
If the error list is visible, hide it. Otherwise, show it."
(interactive)
(-if-let (window (flycheck-get-error-list-window))
(quit-window nil window)
(if-let ((window (flycheck-get-error-list-window)))
(save-selected-window (quit-window nil window))
(flycheck-list-errors)))
(defun spacemacs/goto-flycheck-error-list ()