diff options
author | Wei-Chung Wen <morisato3711@gmail.com> | 2021-07-15 13:13:39 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-07-15 13:13:39 +0200 |
commit | 1557b16dad2b1a3466a93d015575cd7fdb4661c9 (patch) | |
tree | 958c6b32a7a66e5afb8949e3763dd5fa639ee208 /src/testdir | |
parent | 1a71d31bf34b0b2b08517903826004ec6fd440e5 (diff) |
patch 8.2.3163: location list window may open a wrong filev8.2.3163
Problem: Location list window may open a wrong file.
Solution: Also update the qf_ptr field. (Wei-Chung Wen, closes #8565,
closes #8566)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_quickfix.vim | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index a6a20a8451..e5a6d6cdbc 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -5554,4 +5554,37 @@ func Test_vimgrep_fuzzy_match() call delete('Xfile2') endfunc +func Test_locationlist_open_in_newtab() + call s:create_test_file('Xqftestfile1') + call s:create_test_file('Xqftestfile2') + call s:create_test_file('Xqftestfile3') + + %bwipe! + + lgetexpr ['Xqftestfile1:5:Line5', + \ 'Xqftestfile2:10:Line10', + \ 'Xqftestfile3:16:Line16'] + + silent! llast + call assert_equal(1, tabpagenr('$')) + call assert_equal('Xqftestfile3', bufname()) + + set switchbuf=newtab + + silent! lfirst + call assert_equal(2, tabpagenr('$')) + call assert_equal('Xqftestfile1', bufname()) + + silent! lnext + call assert_equal(3, tabpagenr('$')) + call assert_equal('Xqftestfile2', bufname()) + + call delete('Xqftestfile1') + call delete('Xqftestfile2') + call delete('Xqftestfile3') + set switchbuf&vim + + %bwipe! +endfunc + " vim: shiftwidth=2 sts=2 expandtab |