Skip to content

Commit

Permalink
syntax-checking: prevent changing window when quitting error list
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lebensterben committed Jul 13, 2022
1 parent 99933b1 commit 4636672
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layers/+checkers/syntax-checking/funcs.el
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand Down

0 comments on commit 4636672

Please sign in to comment.