Add function 'spacemacs/last-error

Sometimes it is useful to go directly to the last error message in the buffer.
This function recursively calls 'spacemacs/next-error until the last error is
reached.
The binding "SPC e l" is associated with it
This commit is contained in:
Benoit Coste 2018-05-07 12:06:27 +02:00 committed by smile13241324
parent 06cf8e3842
commit 93ac5203b4
2 changed files with 7 additions and 0 deletions

View File

@ -371,6 +371,12 @@ is not visible. Otherwise delegates to regular Emacs next-error."
((eq 'flycheck sys) (call-interactively 'flycheck-next-error))
((eq 'emacs sys) (call-interactively 'next-error)))))
(defun spacemacs/last-error ()
"Go to last flycheck or standard emacs error."
(interactive)
(spacemacs/next-error)
(spacemacs/last-error))
(defun spacemacs/previous-error (&optional n reset)
"Dispatch to flycheck or standard emacs error."
(interactive "P")

View File

@ -190,6 +190,7 @@
'spacemacs/theme-transient-state/spacemacs/cycle-spacemacs-theme-backward)
;; errors ---------------------------------------------------------------------
(spacemacs/set-leader-keys
"el" 'spacemacs/last-error
"en" 'spacemacs/next-error
"eN" 'spacemacs/previous-error
"ep" 'spacemacs/previous-error)