From 325fcc25dd4a6ceaa8e2ff500f30b1175bfcde43 Mon Sep 17 00:00:00 2001 From: w0rp Date: Wed, 8 Feb 2017 22:14:07 +0000 Subject: [PATCH] #314 Use the quickfix list for jumping between errors if that is set instead of the loclist --- autoload/ale/loclist_jumping.vim | 16 ++++++++++++++-- 1 file 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 " 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