Add ingo#window#quickfix#GetOtherList() variant of ingo#window#quickfix#GetList() that gets the quickfixType passed in

This commit is contained in:
Ingo Karkat
2020-02-28 22:00:20 +01:00
parent 6bf28ce092
commit d543bf4e18
3 changed files with 27 additions and 1 deletions
+2
View File
@@ -153,6 +153,8 @@ HISTORY
- ingo#selection#Get{In,Ex}clusiveEndPos(): Prevent "E951: \\% value too large"
by checking line length. This condition typically happens with a linewise
selection (where the column is 2147483647).
- Add ingo#window#quickfix#GetOtherList() variant of
ingo#window#quickfix#GetList() that gets the quickfixType passed in.
##### 1.040 31-Oct-2019
- Add ingo#str#TrimTrailing() variant of ingo#str#Trim().
+23 -1
View File
@@ -2,7 +2,7 @@
"
" DEPENDENCIES:
"
" Copyright: (C) 2010-2019 Ingo Karkat
" Copyright: (C) 2010-2020 Ingo Karkat
" The VIM LICENSE applies to this script; see ':help copyright'.
"
" Maintainer: Ingo Karkat <ingo@karkat.de>
@@ -93,6 +93,28 @@ function! ingo#window#quickfix#GetList()
throw 'ASSERT: Invalid quickfix type: ' . l:quickfixType
endif
endfunction
function! ingo#window#quickfix#GetOtherList( quickfixType ) abort
"******************************************************************************
"* PURPOSE:
" Return a list with all the quickfix / location list errors.
"* ASSUMPTIONS / PRECONDITIONS:
" None.
"* EFFECTS / POSTCONDITIONS:
" None.
"* INPUTS:
" a:quickfixType 1 for quickfix window, 2 for the current window's location
" list. N + 2 for window N's location list
"* RETURN VALUES:
" List.
"******************************************************************************
if a:quickfixType == 1
return getqflist()
elseif a:quickfixType >= 2
return getloclist(a:quickfixType - 2)
else
throw 'ASSERT: Invalid quickfix type: ' . a:quickfixType
endif
endfunction
function! ingo#window#quickfix#SetList( ... )
"******************************************************************************
"* PURPOSE:
+2
View File
@@ -168,6 +168,8 @@ HISTORY *ingo-library-history*
- ingo#selection#Get{In,Ex}clusiveEndPos(): Prevent "E951: \% value too large"
by checking line length. This condition typically happens with a linewise
selection (where the column is 2147483647).
- Add ingo#window#quickfix#GetOtherList() variant of
ingo#window#quickfix#GetList() that gets the quickfixType passed in.
1.040 31-Oct-2019
- Add ingo#str#TrimTrailing() variant of ingo#str#Trim().