From e88eb6c4157a6f5b517588a632c0dae6eb79fcea Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 6 Jun 2017 17:01:17 +0100 Subject: [PATCH] Use BufWinEnter for g:ale_lint_on_enter instead --- doc/ale.txt | 6 +++--- plugin/ale.vim | 2 +- test/test_ale_init_au_groups.vader | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/ale.txt b/doc/ale.txt index f51c643..955e387 100644 --- a/doc/ale.txt +++ b/doc/ale.txt @@ -393,9 +393,9 @@ g:ale_lint_on_enter *g:ale_lint_on_enter* Type: |Number| Default: `1` - When this option is set to `1`, the |BufEnter| and |BufRead| events will be - used to apply linters when buffers are first opened. If this is not desired, - this variable can be set to `0` in your vimrc file to disable this + When this option is set to `1`, the |BufWinEnter| and |BufRead| events will + be used to apply linters when buffers are first opened. If this is not + desired, this variable can be set to `0` in your vimrc file to disable this behaviour. diff --git a/plugin/ale.vim b/plugin/ale.vim index 4a3f652..2bc0c10 100644 --- a/plugin/ale.vim +++ b/plugin/ale.vim @@ -205,7 +205,7 @@ function! ALEInitAuGroups() abort augroup ALERunOnEnterGroup autocmd! 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 augroup END diff --git a/test/test_ale_init_au_groups.vader b/test/test_ale_init_au_groups.vader index 503b7c2..7cc3e6a 100644 --- a/test/test_ale_init_au_groups.vader +++ b/test/test_ale_init_au_groups.vader @@ -112,12 +112,12 @@ Execute (g:ale_lint_on_enter = 0 should bind no events): 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 AssertEqual [ - \ 'BufEnter * call ale#Queue(300, ''lint_file'')', \ 'BufReadPost * call ale#Queue(300, ''lint_file'')', + \ 'BufWinEnter * call ale#Queue(300, ''lint_file'')', \], CheckAutocmd('ALERunOnEnterGroup') Execute (g:ale_lint_on_filetype_changed = 0 should bind no events):