diff options
author | w0rp <devw0rp@gmail.com> | 2017-02-08 22:14:07 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2017-02-08 22:14:07 +0000 |
commit | 325fcc25dd4a6ceaa8e2ff500f30b1175bfcde43 (patch) | |
tree | c7c3c87a2b4009b2cf039c7418fccc9000816e6c | |
parent | eb37d9c1fc6d129900fe7103e0fdf105e2ab7df2 (diff) | |
download | ale-325fcc25dd4a6ceaa8e2ff500f30b1175bfcde43.zip |
#314 Use the quickfix list for jumping between errors if that is set instead of the loclist
-rw-r--r-- | autoload/ale/loclist_jumping.vim | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/autoload/ale/loclist_jumping.vim b/autoload/ale/loclist_jumping.vim index b9ea9d13..b4d1993f 100644 --- a/autoload/ale/loclist_jumping.vim +++ b/autoload/ale/loclist_jumping.vim @@ -1,11 +1,23 @@ " Author: w0rp <devw0rp@gmail.com> " Description: This file implements functions for jumping around in a file -" based on errors and warnings in the loclist. +" based on errors and warnings in the loclist or quickfix list. + +function! s:GetCurrentList() abort + if g:ale_set_loclist + return getloclist(winnr()) + elseif g:ale_set_quickfix + let l:buffer = bufnr('%') + + return filter(getqflist(), 'get(v:val, ''bufnr'', -1) == ' . l:buffer) + endif + + return [] +endfunction function! s:GetSortedLoclist() abort let l:loclist = [] - for l:item in getloclist(winnr()) + for l:item in s:GetCurrentList() if l:item.lnum < 1 " Remove items we can't even jump to. continue |