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
1 changed files with 2 additions and 2 deletions

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 ()