diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-04-07 12:04:51 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-04-07 12:04:51 +0200 |
commit | 39803d82dbb215d2eea9fcd6cf2961b71515a438 (patch) | |
tree | 280abaf998686e393c45a11eaebeefcc30c15681 | |
parent | 08499f5a4d24cb7298b9730a22b2f84f2207c4d0 (diff) |
patch 8.1.1134: buffer for quickfix window is reused for another filev8.1.1134
Problem: Buffer for quickfix window is reused for another file.
Solution: Don't reuse the quickfx buffer. (Yegappan Lakshmanan)
-rw-r--r-- | src/buffer.c | 1 | ||||
-rw-r--r-- | src/testdir/test_quickfix.vim | 14 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/buffer.c b/src/buffer.c index b9b44886c4..187a8a6482 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -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()); } diff --git a/src/testdir/test_quickfix.vim b/src/testdir/test_quickfix.vim index bb25e64c83..6099dcf34e 100644 --- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -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 diff --git a/src/version.c b/src/version.c index 9f62232178..4ffd63b980 100644 --- a/src/version.c +++ b/src/version.c @@ -772,6 +772,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1134, +/**/ 1133, /**/ 1132, |