mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Treat ale_open_list integer values as thresholds (#4050)
Only open list window if the number of warnings or errors equals to or exceeds the value of ale_open_list. No change when set to `1`. Co-authored-by: cos <cos>
This commit is contained in:
@@ -97,6 +97,34 @@ Execute(The quickfix window should open for just the loclist):
|
||||
call ale#list#SetLists(bufnr('%'), [])
|
||||
Assert !ale#list#IsQuickfixOpen()
|
||||
|
||||
Execute(The quickfix window should open on the correct threshold):
|
||||
" The window should open for a value lower than number of entries.
|
||||
let g:ale_open_list = len(g:loclist) - 1
|
||||
call ale#list#SetLists(bufnr('%'), g:loclist)
|
||||
Assert ale#list#IsQuickfixOpen()
|
||||
|
||||
" Clear the list to be ready for a new value.
|
||||
call ale#list#SetLists(bufnr('%'), [])
|
||||
Assert !ale#list#IsQuickfixOpen()
|
||||
|
||||
" It should also open for a value equal to the number of entries.
|
||||
let g:ale_open_list = len(g:loclist)
|
||||
call ale#list#SetLists(bufnr('%'), g:loclist)
|
||||
Assert ale#list#IsQuickfixOpen()
|
||||
|
||||
" Clear the list again, preparing for a final value.
|
||||
call ale#list#SetLists(bufnr('%'), [])
|
||||
Assert !ale#list#IsQuickfixOpen()
|
||||
|
||||
" Window should not open for values higher than number of loclist entries.
|
||||
let g:ale_open_list = len(g:loclist) + 1
|
||||
call ale#list#SetLists(bufnr('%'), g:loclist)
|
||||
Assert !ale#list#IsQuickfixOpen()
|
||||
|
||||
" Clear the list just to clean up.
|
||||
call ale#list#SetLists(bufnr('%'), [])
|
||||
Assert !ale#list#IsQuickfixOpen()
|
||||
|
||||
Execute(The quickfix window height should be correct for the loclist):
|
||||
let g:ale_open_list = 1
|
||||
let g:ale_list_window_size = 7
|
||||
|
||||
Reference in New Issue
Block a user