aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorVVKot <volodymyr.kot.ua@gmail.com>2021-12-19 11:00:04 +0000
committerzeertzjq <zeertzjq@outlook.com>2022-03-13 13:17:28 +0800
commitc5e47e44aa139fa4f9e2f31fe591ddd6b5ca4909 (patch)
tree1e2d1af815d77f623371c60749c347f1346139cc /src/nvim/testdir
parentdc32a20503902a91ff7d6383521bf5dfef839876 (diff)
downloadrneovim-c5e47e44aa139fa4f9e2f31fe591ddd6b5ca4909.tar.gz
rneovim-c5e47e44aa139fa4f9e2f31fe591ddd6b5ca4909.tar.bz2
rneovim-c5e47e44aa139fa4f9e2f31fe591ddd6b5ca4909.zip
vim-patch:8.2.3759: quickfix buffer becomes hidden while still in a window
Problem: Quickfix buffer becomes hidden while still in a window. Solution: Check if the closed window is the last window showing the quickfix buffer. (Yegappan Lakshmanan, closes vim/vim#9303, closes vim/vim#9300) https://github.com/vim/vim/commit/78a61068cf2c83e611d954a0fb413a09ad59dc07
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_quickfix.vim36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index 842e5fe5d7..48bafc4b7e 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -5446,4 +5446,40 @@ func Test_win_gettype()
lclose
endfunc
+" Test for opening the quickfix window in two tab pages and then closing one
+" of the quickfix windows. This should not make the quickfix buffer unlisted.
+" (github issue #9300).
+func Test_two_qf_windows()
+ cexpr "F1:1:line1"
+ copen
+ tabnew
+ copen
+ call assert_true(&buflisted)
+ cclose
+ tabfirst
+ call assert_true(&buflisted)
+ let bnum = bufnr()
+ cclose
+ " if all the quickfix windows are closed, then buffer should be unlisted.
+ call assert_false(buflisted(bnum))
+ %bw!
+
+ " Repeat the test for a location list
+ lexpr "F2:2:line2"
+ lopen
+ let bnum = bufnr()
+ tabnew
+ exe "buffer" bnum
+ tabfirst
+ lclose
+ tablast
+ call assert_true(buflisted(bnum))
+ tabclose
+ lopen
+ call assert_true(buflisted(bnum))
+ lclose
+ call assert_false(buflisted(bnum))
+ %bw!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab