diff options
author | cs86661 <cs86661@msn.com> | 2017-06-01 05:55:23 +0800 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2017-05-31 22:55:23 +0100 |
commit | 81f27a99c882fde3dfa004e6494efcd27b5d5e96 (patch) | |
tree | 228fc7470c7dbb1ce2ed831f2dd9545680385c15 /autoload | |
parent | 735a6a2a885d8c5581a19f16998b4b6209742bd5 (diff) | |
download | ale-81f27a99c882fde3dfa004e6494efcd27b5d5e96.zip |
Set qflist/loclist window title properly ... (#588)
* Update list.vim
Set qflist/loclist window title properly ...
* Update list.vim
1. Remove redundant code.
2. Get absolute path from 'a:buffer'.
* Set the list window titles appropriately for each version of Vim, and add tests
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/list.vim | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/autoload/ale/list.vim b/autoload/ale/list.vim index 63d51ab5..ea6d958c 100644 --- a/autoload/ale/list.vim +++ b/autoload/ale/list.vim @@ -12,18 +12,26 @@ function! ale#list#IsQuickfixOpen() abort endfunction function! ale#list#SetLists(buffer, loclist) abort + let l:title = expand('#' . a:buffer . ':p') + if g:ale_set_quickfix - call setqflist(a:loclist) + if has('nvim') + call setqflist(a:loclist, ' ', l:title) + else + call setqflist(a:loclist) + call setqflist([], 'r', {'title': l:title}) + endif elseif g:ale_set_loclist " If windows support is off, bufwinid() may not exist. - if exists('*bufwinid') - " Set the results on the window for the buffer. - call setloclist(bufwinid(str2nr(a:buffer)), a:loclist) + " We'll set result in the current window, which might not be correct, + " but is better than nothing. + let l:win_id = exists('*bufwinid') ? bufwinid(str2nr(a:buffer)) : 0 + + if has('nvim') + call setloclist(l:win_id, a:loclist, ' ', l:title) else - " Set the results in the current window. - " This may not be the same window we ran the linters for, but - " it's better than nothing. - call setloclist(0, a:loclist) + call setloclist(l:win_id, a:loclist) + call setloclist(l:win_id, [], 'r', {'title': l:title}) endif endif |