diff options
author | w0rp <devw0rp@gmail.com> | 2017-07-24 09:29:54 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-07-24 09:30:41 +0100 |
commit | e45c16d9bbcf7b9df09ce40ef467b13a49108487 (patch) | |
tree | 281b980b0132c657c116ba2ed4b7cdd399f642ce /autoload/ale/list.vim | |
parent | e0c014ab8c5e687daf9954108c31e1fa19a68c43 (diff) | |
download | ale-e45c16d9bbcf7b9df09ce40ef467b13a49108487.zip |
Fix #796 - Ignore errors for closing the last window
Diffstat (limited to 'autoload/ale/list.vim')
-rw-r--r-- | autoload/ale/list.vim | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/autoload/ale/list.vim b/autoload/ale/list.vim index 75b4ef38..9fe35bf3 100644 --- a/autoload/ale/list.vim +++ b/autoload/ale/list.vim @@ -59,13 +59,17 @@ function! ale#list#CloseWindowIfNeeded(buffer) abort return endif - " Only close windows if the quickfix list or loclist is completely empty, - " including errors set through other means. - if g:ale_set_quickfix - if empty(getqflist()) - cclose + try + " Only close windows if the quickfix list or loclist is completely empty, + " including errors set through other means. + if g:ale_set_quickfix + if empty(getqflist()) + cclose + endif + elseif g:ale_set_loclist && empty(getloclist(0)) + lclose endif - elseif g:ale_set_loclist && empty(getloclist(0)) - lclose - endif + " Ignore 'Cannot close last window' errors. + catch /E444/ + endtry endfunction |