diff src/testdir/test_quickfix.vim @ 26464:c0cb28384dc2 v8.2.3762

patch 8.2.3762: if quickfix buffer is wiped out getqflist() still returns it Commit: https://github.com/vim/vim/commit/56150da6879a96db1c84c7ec4ceedeb84969f606 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Thu Dec 9 09:27:06 2021 +0000 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 #9306)
author Bram Moolenaar <Bram@vim.org>
date Thu, 09 Dec 2021 10:30:04 +0100
parents 824fe105f5b9
children 13ba00ef7687
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -4626,6 +4626,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