vim-patch:8.2.3762: if quickfix buffer is wiped out getqflist() still returns it

Problem:    If the quickfix buffer is wiped out getqflist() still returns its
            number.
Solution:   Use zero if the buffer is no longer present. (Yegappan Lakshmanan,
            closes vim/vim#9306)
56150da687
This commit is contained in:
VVKot
2021-12-19 11:06:16 +00:00
committed by zeertzjq
parent c5e47e44aa
commit ff48e61ec9
2 changed files with 16 additions and 3 deletions

View File

@@ -4483,6 +4483,13 @@ func Xqfbuf_test(cchar)
call assert_equal(qfbnum, bufnr(''))
Xclose
" When quickfix buffer is wiped out, getqflist() should return 0
%bw!
Xexpr ""
Xopen
bw!
call assert_equal(0, g:Xgetlist({'qfbufnr': 0}).qfbufnr)
if a:cchar == 'l'
%bwipe
" For a location list, when both the file window and the location list