mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-20 11:11:13 +08:00
Fix #314 - quickfix should take precedence over loclist for jumping
This commit is contained in:
@@ -6,10 +6,10 @@ function! s:GetCurrentList() abort
|
|||||||
let l:buffer = bufnr('%')
|
let l:buffer = bufnr('%')
|
||||||
let l:list = []
|
let l:list = []
|
||||||
|
|
||||||
if g:ale_set_loclist
|
if g:ale_set_quickfix
|
||||||
let l:list = getloclist(winnr())
|
|
||||||
elseif g:ale_set_quickfix
|
|
||||||
let l:list = getqflist()
|
let l:list = getqflist()
|
||||||
|
elseif g:ale_set_loclist
|
||||||
|
let l:list = getloclist(winnr())
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return filter(l:list, 'get(v:val, ''bufnr'', -1) == ' . l:buffer)
|
return filter(l:list, 'get(v:val, ''bufnr'', -1) == ' . l:buffer)
|
||||||
|
|||||||
@@ -72,3 +72,15 @@ Execute(An empty List should be returned when both lists are turned off):
|
|||||||
call setloclist(winnr(), [{'lnum': 1, 'col': 1, 'text': 'foo', 'bufnr': bufnr('%')}])
|
call setloclist(winnr(), [{'lnum': 1, 'col': 1, 'text': 'foo', 'bufnr': bufnr('%')}])
|
||||||
|
|
||||||
AssertEqual [], GetList()
|
AssertEqual [], GetList()
|
||||||
|
|
||||||
|
Execute(quickfix should take precedence over loclist when on):
|
||||||
|
let g:ale_set_quickfix = 1
|
||||||
|
|
||||||
|
call setloclist(winnr(), [
|
||||||
|
\ {'lnum': 1, 'col': 1, 'text': 'ignore this', 'bufnr': g:buffer}
|
||||||
|
\])
|
||||||
|
call setqflist([
|
||||||
|
\ {'lnum': 1, 'col': 1, 'text': 'foo', 'bufnr': g:buffer},
|
||||||
|
\])
|
||||||
|
|
||||||
|
AssertEqual [{'lnum': 1, 'col': 1, 'text': 'foo'}], GetList()
|
||||||
|
|||||||
Reference in New Issue
Block a user