Use BufWinEnter for g:ale_lint_on_enter instead

This commit is contained in:
w0rp 2017-06-06 17:01:17 +01:00
parent 3c5156d4a4
commit e88eb6c415
3 changed files with 6 additions and 6 deletions

View File

@ -393,9 +393,9 @@ g:ale_lint_on_enter *g:ale_lint_on_enter*
Type: |Number| Type: |Number|
Default: `1` Default: `1`
When this option is set to `1`, the |BufEnter| and |BufRead| events will be When this option is set to `1`, the |BufWinEnter| and |BufRead| events will
used to apply linters when buffers are first opened. If this is not desired, be used to apply linters when buffers are first opened. If this is not
this variable can be set to `0` in your vimrc file to disable this desired, this variable can be set to `0` in your vimrc file to disable this
behaviour. behaviour.

View File

@ -205,7 +205,7 @@ function! ALEInitAuGroups() abort
augroup ALERunOnEnterGroup augroup ALERunOnEnterGroup
autocmd! autocmd!
if g:ale_enabled && g:ale_lint_on_enter if g:ale_enabled && g:ale_lint_on_enter
autocmd BufEnter,BufRead * call ale#Queue(300, 'lint_file') autocmd BufWinEnter,BufRead * call ale#Queue(300, 'lint_file')
endif endif
augroup END augroup END

View File

@ -112,12 +112,12 @@ Execute (g:ale_lint_on_enter = 0 should bind no events):
AssertEqual [], CheckAutocmd('ALERunOnEnterGroup') AssertEqual [], CheckAutocmd('ALERunOnEnterGroup')
Execute (g:ale_lint_on_enter = 1 should bind no BufReadPost and BufEnter): Execute (g:ale_lint_on_enter = 1 should bind no BufReadPost and BufWinEnter):
let g:ale_lint_on_enter = 1 let g:ale_lint_on_enter = 1
AssertEqual [ AssertEqual [
\ 'BufEnter * call ale#Queue(300, ''lint_file'')',
\ 'BufReadPost * call ale#Queue(300, ''lint_file'')', \ 'BufReadPost * call ale#Queue(300, ''lint_file'')',
\ 'BufWinEnter * call ale#Queue(300, ''lint_file'')',
\], CheckAutocmd('ALERunOnEnterGroup') \], CheckAutocmd('ALERunOnEnterGroup')
Execute (g:ale_lint_on_filetype_changed = 0 should bind no events): Execute (g:ale_lint_on_filetype_changed = 0 should bind no events):