mirror of
https://github.com/neovim/neovim.git
synced 2026-04-25 16:54:12 +00:00
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)
78a61068cf
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user