Skip to content

Commit 39803d8

Browse files
committed
patch 8.1.1134: buffer for quickfix window is reused for another file
Problem: Buffer for quickfix window is reused for another file. Solution: Don't reuse the quickfx buffer. (Yegappan Lakshmanan)
1 parent 08499f5 commit 39803d8

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

src/buffer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,7 @@ curbuf_reusable(void)
18531853
&& curbuf->b_ffname == NULL
18541854
&& curbuf->b_nwindows <= 1
18551855
&& (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY())
1856+
&& !bt_quickfix(curbuf)
18561857
&& !curbufIsChanged());
18571858
}
18581859

src/testdir/test_quickfix.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4012,3 +4012,17 @@ func Test_winonly_autocmd()
40124012
new | only
40134013
call delete('Xtest1')
40144014
endfunc
4015+
4016+
" Test to make sure that an empty quickfix buffer is not reused for loading
4017+
" a normal buffer.
4018+
func Test_empty_qfbuf()
4019+
enew | only
4020+
call writefile(["Test"], 'Xfile1')
4021+
call setqflist([], 'f')
4022+
copen | only
4023+
let qfbuf = bufnr('')
4024+
edit Xfile1
4025+
call assert_notequal(qfbuf, bufnr(''))
4026+
enew
4027+
call delete('Xfile1')
4028+
endfunc

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1134,
774776
/**/
775777
1133,
776778
/**/

0 commit comments

Comments
 (0)