Add support for linting when a file is saved.

This commit is contained in:
w0rp 2016-10-04 21:31:47 +01:00
parent aebf8e0196
commit a95aa97780
2 changed files with 10 additions and 0 deletions

View file

@ -20,6 +20,9 @@ let g:ale_lint_delay = get(g:, 'ale_lint_delay', 100)
" This flag can be set to 0 to disable linting when the buffer is entered.
let g:ale_lint_on_enter = get(g:, 'ale_lint_on_enter', 1)
" This flag can be set to 1 to enable linting when a buffer is written.
let g:ale_lint_on_save = get(g:, 'ale_lint_on_save', 0)
" This flag can be set to 0 to disable setting the loclist.
let g:ale_set_loclist = get(g:, 'ale_set_loclist', 1)

View file

@ -354,6 +354,13 @@ if g:ale_lint_on_enter
augroup END
endif
if g:ale_lint_on_save
augroup ALERunOnSaveGroup
autocmd!
autocmd BufWrite * call ALELint(0)
augroup END
endif
" Clean up buffers automatically when they are unloaded.
augroup ALEBuffferCleanup
autocmd!