]> granicus.if.org Git - vim/commitdiff
patch 8.1.1134: buffer for quickfix window is reused for another file v8.1.1134
authorBram Moolenaar <Bram@vim.org>
Sun, 7 Apr 2019 10:04:51 +0000 (12:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 7 Apr 2019 10:04:51 +0000 (12:04 +0200)
Problem:    Buffer for quickfix window is reused for another file.
Solution:   Don't reuse the quickfx buffer. (Yegappan Lakshmanan)

src/buffer.c
src/testdir/test_quickfix.vim
src/version.c

index b9b44886c4f7195b541a6f09b305fbd5dc83f180..187a8a648252b59767ccb9ee46cfec6b4a364667 100644 (file)
@@ -1853,6 +1853,7 @@ curbuf_reusable(void)
        && curbuf->b_ffname == NULL
        && curbuf->b_nwindows <= 1
        && (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY())
+       && !bt_quickfix(curbuf)
        && !curbufIsChanged());
 }
 
index bb25e64c830664477a8493bd71f1e07fcafa0adc..6099dcf34ef911e87cdbe1723ffddeeaf09bbba5 100644 (file)
@@ -4012,3 +4012,17 @@ func Test_winonly_autocmd()
   new | only
   call delete('Xtest1')
 endfunc
+
+" Test to make sure that an empty quickfix buffer is not reused for loading
+" a normal buffer.
+func Test_empty_qfbuf()
+  enew | only
+  call writefile(["Test"], 'Xfile1')
+  call setqflist([], 'f')
+  copen | only
+  let qfbuf = bufnr('')
+  edit Xfile1
+  call assert_notequal(qfbuf, bufnr(''))
+  enew
+  call delete('Xfile1')
+endfunc
index 9f62232178ac49eef0d94824fae622ba2ecb37b7..4ffd63b980c34f0e990b0f2b39a741c687c3698d 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1134,
 /**/
     1133,
 /**/