From 7b219c638d43c12a42d75832fd09d7b2e86090bf Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sun, 14 Apr 2019 18:18:21 -0400 Subject: 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) https://github.com/vim/vim/commit/fc2b270cfd36230166df486aae4d96d9d1f32755 --- src/nvim/testdir/test_quickfix.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 7c4d1d3b81..f50f33d255 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -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() -- cgit