Run before lint cycle, rename autocmds

This commit is contained in:
Martin Tournoij
2017-12-10 13:03:03 +00:00
parent d6bf13502a
commit 4825cce1cc
4 changed files with 37 additions and 49 deletions

View File

@@ -321,6 +321,8 @@ function! ale#engine#SetResults(buffer, loclist) abort
call ale#engine#RemoveManagedFiles(a:buffer)
" Call user autocommands. This allows users to hook into ALE's lint cycle.
silent doautocmd <nomodeline> User ALELintPost
" Old DEPRECATED name; call it for backwards compatibility.
silent doautocmd <nomodeline> User ALELint
endif
endfunction
@@ -556,8 +558,6 @@ function! s:RunJob(options) abort
\ 'output': [],
\ 'next_chain_index': l:next_chain_index,
\}
silent doautocmd <nomodeline> User ALEStartLint
endif
if g:ale_history_enabled
@@ -787,6 +787,8 @@ function! ale#engine#RunLinters(buffer, linters, should_lint_file) abort
" We can only clear the results if we aren't checking the buffer.
let l:can_clear_results = !ale#engine#IsCheckingBuffer(a:buffer)
silent doautocmd <nomodeline> User ALELintPre
for l:linter in a:linters
" Only run lint_file linters if we should.
if !l:linter.lint_file || a:should_lint_file