Fix #833 - Do not open windows on save when the option is off

This commit is contained in:
w0rp 2017-08-08 07:29:10 +01:00
parent 16cfedf04a
commit 5010ddc28f
2 changed files with 9 additions and 1 deletions

View File

@ -18,7 +18,7 @@ function! s:ShouldOpen(buffer) abort
let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0) let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0)
return (type(l:val) == type(1) && l:val == 1) return (type(l:val) == type(1) && l:val == 1)
\ || (l:val ==# 'on_save' && l:saved) \ || (type(l:val) == type('') && l:val ==# 'on_save' && l:saved)
endfunction endfunction
function! ale#list#SetLists(buffer, loclist) abort function! ale#list#SetLists(buffer, loclist) abort

View File

@ -197,3 +197,11 @@ Execute(The ale_open_list='on_save' option should work):
call ale#list#SetLists(bufnr('%'), g:loclist) call ale#list#SetLists(bufnr('%'), g:loclist)
" Now the list should have opened. " Now the list should have opened.
Assert ale#list#IsQuickfixOpen() Assert ale#list#IsQuickfixOpen()
Execute(The window shouldn't open on save when ale_open_list=0):
let b:ale_open_list = 0
let b:ale_save_event_fired = 1
call ale#list#SetLists(bufnr('%'), g:loclist)
" Now the list should have opened.
Assert !ale#list#IsQuickfixOpen()