mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-10 06:21:53 +08:00
Fix #687 - Check files on enter if they have changed
This commit is contained in:
@@ -12,3 +12,22 @@ function! ale#events#SaveEvent() abort
|
||||
call ale#Queue(0, 'lint_file')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:LintOnEnter() abort
|
||||
if g:ale_enabled && g:ale_lint_on_enter && has_key(b:, 'ale_file_changed')
|
||||
call remove(b:, 'ale_file_changed')
|
||||
call ale#Queue(0, 'lint_file')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#events#EnterEvent() abort
|
||||
call s:LintOnEnter()
|
||||
endfunction
|
||||
|
||||
function! ale#events#FileChangedEvent(buffer) abort
|
||||
call setbufvar(a:buffer, 'ale_file_changed', 1)
|
||||
|
||||
if bufnr('') == a:buffer
|
||||
call s:LintOnEnter()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user