mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-09 03:01:31 +08:00
Add ALEPopulateQuickfix and ALEPopulateLocList (#3761)
Closes #1810 Add ALEPopulateQuickfix and ALEPopulateLocList. They're not very useful with ale's default auto-populate behaviour, so their useful configuration is described in help.
This commit is contained in:
@@ -212,6 +212,23 @@ function! ale#list#SetLists(buffer, loclist) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#list#ForcePopulateErrorList(populate_quickfix) abort
|
||||
let l:quickfix_bak = g:ale_set_quickfix
|
||||
let g:ale_set_quickfix = a:populate_quickfix
|
||||
let l:loclist_bak = g:ale_set_loclist
|
||||
let g:ale_set_loclist = !a:populate_quickfix
|
||||
let l:open_list_bak = g:ale_open_list
|
||||
let g:ale_open_list = 1
|
||||
|
||||
let l:buffer = bufnr('')
|
||||
let l:loclist = get(g:ale_buffer_info, l:buffer, {'loclist': []}).loclist
|
||||
call s:SetListsImpl(-1, l:buffer, l:loclist)
|
||||
|
||||
let g:ale_open_list = l:open_list_bak
|
||||
let g:ale_set_loclist = l:loclist_bak
|
||||
let g:ale_set_quickfix = l:quickfix_bak
|
||||
endfunction
|
||||
|
||||
function! s:CloseWindowIfNeeded(buffer) abort
|
||||
if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user