mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
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:
parent
a8d0062c67
commit
7381c93e2c
@ -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());
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user