mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-28 14:56:52 +08:00
Merge pull request #411 from lucaskolstad/lint_on_enter_bugfix
#272 Check if quickfix window is open before reopening
This commit is contained in:
@@ -36,10 +36,12 @@ function! ale#list#SetLists(buffer, loclist) abort
|
||||
if len(a:loclist) > 0 || g:ale_keep_list_window_open
|
||||
let l:winnr = winnr()
|
||||
|
||||
if g:ale_set_quickfix
|
||||
copen
|
||||
elseif g:ale_set_loclist
|
||||
lopen
|
||||
if !ale#list#IsQuickfixOpen()
|
||||
if g:ale_set_quickfix
|
||||
copen
|
||||
elseif g:ale_set_loclist
|
||||
lopen
|
||||
endif
|
||||
endif
|
||||
|
||||
" If focus changed, restore it (jump to the last window).
|
||||
|
||||
@@ -49,6 +49,10 @@ Execute(The quickfix window should open for just the loclist):
|
||||
call ale#list#SetLists(bufnr('%'), g:loclist)
|
||||
Assert ale#list#IsQuickfixOpen()
|
||||
|
||||
" Clear the list and it should close again.
|
||||
call ale#list#SetLists(bufnr('%'), [])
|
||||
Assert !ale#list#IsQuickfixOpen()
|
||||
|
||||
Execute(The quickfix window should stay open for just the loclist):
|
||||
let g:ale_open_list = 1
|
||||
let g:ale_keep_list_window_open = 1
|
||||
@@ -76,6 +80,10 @@ Execute(The quickfix window should open for the quickfix list):
|
||||
call ale#list#SetLists(bufnr('%'), g:loclist)
|
||||
Assert ale#list#IsQuickfixOpen()
|
||||
|
||||
" Clear the list and it should close again.
|
||||
call ale#list#SetLists(bufnr('%'), [])
|
||||
Assert !ale#list#IsQuickfixOpen()
|
||||
|
||||
Execute(The quickfix window should stay open for the quickfix list):
|
||||
let g:ale_set_quickfix = 1
|
||||
let g:ale_open_list = 1
|
||||
|
||||
Reference in New Issue
Block a user