diff options
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/events.vim | 11 | ||||
-rw-r--r-- | autoload/ale/fix.vim | 4 |
2 files changed, 13 insertions, 2 deletions
diff --git a/autoload/ale/events.vim b/autoload/ale/events.vim index efae11c1..1992b1ee 100644 --- a/autoload/ale/events.vim +++ b/autoload/ale/events.vim @@ -1,8 +1,15 @@ " Author: w0rp <devw0rp@gmail.com> +function! ale#events#QuitEvent(buffer) abort + " Remember when ALE is quitting for BufWrite, etc. + call setbufvar(a:buffer, 'ale_quitting', 1) +endfunction + function! ale#events#SaveEvent(buffer) abort call setbufvar(a:buffer, 'ale_save_event_fired', 1) - let l:should_lint = ale#Var(a:buffer, 'enabled') && g:ale_lint_on_save + let l:should_lint = ale#Var(a:buffer, 'enabled') + \ && g:ale_lint_on_save + \ && !getbufvar(a:buffer, 'ale_quitting') if g:ale_fix_on_save let l:will_fix = ale#fix#Fix('save_file') @@ -24,6 +31,8 @@ function! s:LintOnEnter(buffer) abort endfunction function! ale#events#EnterEvent(buffer) abort + " When entering a buffer, we are no longer quitting it. + call setbufvar(a:buffer, 'ale_quitting', 0) let l:filetype = getbufvar(a:buffer, '&filetype') call setbufvar(a:buffer, 'ale_original_filetype', l:filetype) diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim index e1210f17..2b5387de 100644 --- a/autoload/ale/fix.vim +++ b/autoload/ale/fix.vim @@ -56,7 +56,9 @@ function! ale#fix#ApplyQueuedFixes() abort " If ALE linting is enabled, check for problems with the file again after " fixing problems. - if g:ale_enabled && l:should_lint + if g:ale_enabled + \&& l:should_lint + \&& !getbufvar(l:buffer, 'ale_quitting') call ale#Queue(0, l:data.should_save ? 'lint_file' : '') endif endfunction |