vim-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)

39803d82db
This commit is contained in:
Marco Hinz 2019-04-08 20:00:41 +02:00
parent a8d0062c67
commit 7381c93e2c
No known key found for this signature in database
GPG Key ID: 1C980A1B657B4A4F
2 changed files with 15 additions and 0 deletions

View File

@ -1868,6 +1868,7 @@ bool curbuf_reusable(void)
&& curbuf->b_ffname == NULL
&& curbuf->b_nwindows <= 1
&& (curbuf->b_ml.ml_mfp == NULL || BUFEMPTY())
&& !bt_quickfix(curbuf)
&& !curbufIsChanged());
}

View File

@ -2664,3 +2664,17 @@ func Test_qfwin_pos()
call assert_equal(3, winnr())
close
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