1
0
forked from aniani/vim

patch 8.0.1112: can't get size or current index from quickfix list

Problem:    Can't get size or current index from quickfix list.
Solution:   Add "idx" and "size" options. (Yegappan Lakshmanan)
This commit is contained in:
Bram Moolenaar
2017-09-15 22:43:07 +02:00
parent b5e79ef5a9
commit fc2b270cfd
4 changed files with 41 additions and 2 deletions

View File

@@ -430,6 +430,19 @@ func Xtest_browse(cchar)
call delete('Xqftestfile1')
call delete('Xqftestfile2')
" Should be able to use next/prev with invalid entries
Xexpr ""
call assert_equal(0, g:Xgetlist({'idx' : 0}).idx)
call assert_equal(0, g:Xgetlist({'size' : 0}).size)
Xaddexpr ['foo', 'bar', 'baz', 'quux', 'shmoo']
call assert_equal(5, g:Xgetlist({'size' : 0}).size)
Xlast
call assert_equal(5, g:Xgetlist({'idx' : 0}).idx)
Xfirst
call assert_equal(1, g:Xgetlist({'idx' : 0}).idx)
2Xnext
call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
endfunc
func Test_browse()