diff options
author | w0rp <devw0rp@gmail.com> | 2017-11-19 23:44:02 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-11-19 23:44:09 +0000 |
commit | 597507e5197ef51037d01d30ad819a048eea9c9b (patch) | |
tree | 07945599c638ab1bb50097e77f35187fa6938949 /autoload/ale/list.vim | |
parent | 0cb8130d0e65d9a239c43ddb21d2f89b2815f10d (diff) | |
download | ale-597507e5197ef51037d01d30ad819a048eea9c9b.zip |
Make the message formats configurable with buffer local variables
Diffstat (limited to 'autoload/ale/list.vim')
-rw-r--r-- | autoload/ale/list.vim | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/autoload/ale/list.vim b/autoload/ale/list.vim index fbc71efc..b1a8d4a7 100644 --- a/autoload/ale/list.vim +++ b/autoload/ale/list.vim @@ -37,16 +37,14 @@ function! ale#list#GetCombinedList() abort return l:list endfunction -function! s:FixList(list) abort +function! s:FixList(buffer, list) abort + let l:format = ale#Var(a:buffer, 'loclist_msg_format') let l:new_list = [] for l:item in a:list let l:fixed_item = copy(l:item) - let l:fixed_item.text = ale#GetLocItemMessage( - \ l:item, - \ g:ale_loclist_msg_format, - \) + let l:fixed_item.text = ale#GetLocItemMessage(l:item, l:format) if l:item.bufnr == -1 " If the buffer number is invalid, remove it. @@ -70,22 +68,22 @@ function! s:SetListsImpl(timer_id, buffer, loclist) abort let l:quickfix_list = ale#list#GetCombinedList() if has('nvim') - call setqflist(s:FixList(l:quickfix_list), ' ', l:title) + call setqflist(s:FixList(a:buffer, l:quickfix_list), ' ', l:title) else - call setqflist(s:FixList(l:quickfix_list)) + call setqflist(s:FixList(a:buffer, l:quickfix_list)) call setqflist([], 'r', {'title': l:title}) endif elseif g:ale_set_loclist " If windows support is off, bufwinid() may not exist. " We'll set result in the current window, which might not be correct, - " but is better than nothing. - let l:win_id = s:BufWinId(a:buffer) + " but it's better than nothing. + let l:id = s:BufWinId(a:buffer) if has('nvim') - call setloclist(l:win_id, s:FixList(a:loclist), ' ', l:title) + call setloclist(l:id, s:FixList(a:buffer, a:loclist), ' ', l:title) else - call setloclist(l:win_id, s:FixList(a:loclist)) - call setloclist(l:win_id, [], 'r', {'title': l:title}) + call setloclist(l:id, s:FixList(a:buffer, a:loclist)) + call setloclist(l:id, [], 'r', {'title': l:title}) endif endif |