From 5010ddc28fdced941925563bbc55f9219dfa4267 Mon Sep 17 00:00:00 2001 From: w0rp Date: Tue, 8 Aug 2017 07:29:10 +0100 Subject: [PATCH] Fix #833 - Do not open windows on save when the option is off --- autoload/ale/list.vim | 2 +- test/test_list_opening.vader | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/autoload/ale/list.vim b/autoload/ale/list.vim index f7c8ddd6..ae13e10a 100644 --- a/autoload/ale/list.vim +++ b/autoload/ale/list.vim @@ -18,7 +18,7 @@ function! s:ShouldOpen(buffer) abort let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0) 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 function! ale#list#SetLists(buffer, loclist) abort diff --git a/test/test_list_opening.vader b/test/test_list_opening.vader index 253efa46..024e55ae 100644 --- a/test/test_list_opening.vader +++ b/test/test_list_opening.vader @@ -197,3 +197,11 @@ Execute(The ale_open_list='on_save' option should work): call ale#list#SetLists(bufnr('%'), g:loclist) " Now the list should have opened. 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()