tools/flycheck: only check on file save/open
This commit is contained in:
parent
45223b3785
commit
8b5b3deaba
1 changed files with 6 additions and 10 deletions
|
@ -12,8 +12,12 @@ errors.")
|
||||||
:commands flycheck-list-errors flycheck-buffer
|
:commands flycheck-list-errors flycheck-buffer
|
||||||
:after-call doom-switch-buffer-hook after-find-file
|
:after-call doom-switch-buffer-hook after-find-file
|
||||||
:config
|
:config
|
||||||
;; new-line checks are a mote excessive; idle checks are more than enough
|
(setq flycheck-emacs-lisp-load-path 'inherit)
|
||||||
(delq! 'new-line flycheck-check-syntax-automatically)
|
|
||||||
|
;; Check only when saving or opening files. Newline & idle checks are a mote
|
||||||
|
;; excessive, especially when that can easily catch code in an incomplete
|
||||||
|
;; state, so we removed them.
|
||||||
|
(setq flycheck-check-syntax-automatically '(save mode-enabled))
|
||||||
|
|
||||||
(add-hook! 'doom-escape-hook :append
|
(add-hook! 'doom-escape-hook :append
|
||||||
(defun +flycheck-buffer-h ()
|
(defun +flycheck-buffer-h ()
|
||||||
|
@ -22,14 +26,6 @@ errors.")
|
||||||
(ignore-errors (flycheck-buffer))
|
(ignore-errors (flycheck-buffer))
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
(add-hook! 'flycheck-after-syntax-check-hook
|
|
||||||
(defun +flycheck-adjust-syntax-check-eagerness-h ()
|
|
||||||
"Check for errors less often when there aren't any.
|
|
||||||
Done to reduce the load flycheck imposes on the current buffer."
|
|
||||||
(if flycheck-current-errors
|
|
||||||
(kill-local-variable 'flycheck-idle-change-delay)
|
|
||||||
(setq-local flycheck-idle-change-delay +flycheck-lazy-idle-delay))))
|
|
||||||
|
|
||||||
(global-flycheck-mode +1))
|
(global-flycheck-mode +1))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue