diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-10 13:11:34 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-10 20:20:56 -0400 |
| commit | e82b8ddef16eb7ce96e1d3d063ff529f79ed6bb2 (patch) | |
| tree | 4c1558bdccbb800f3b8de73789d18242884101df /src/nvim/testdir/test_quickfix.vim | |
| parent | e9004e2af0479868b1c9860d9cf49d073fdaeeed (diff) | |
| download | rneovim-e82b8ddef16eb7ce96e1d3d063ff529f79ed6bb2.tar.gz rneovim-e82b8ddef16eb7ce96e1d3d063ff529f79ed6bb2.tar.bz2 rneovim-e82b8ddef16eb7ce96e1d3d063ff529f79ed6bb2.zip | |
vim-patch:8.1.0877: new buffer used every time the quickfix window is opened
Problem: New buffer used every time the quickfix window is opened.
Solution: Reuse the buffer. (Yegappan Lakshmanan, closes vim/vim#3902)
https://github.com/vim/vim/commit/ee8188fc74a7cf9ee7acb634b2bb7a032d0cb24c
Diffstat (limited to 'src/nvim/testdir/test_quickfix.vim')
| -rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 6f579920bf..d7eb4806ec 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -4028,6 +4028,49 @@ func Test_viscol() call delete('Xfile1') endfunc +" Test for the quickfix window buffer +func Xqfbuf_test(cchar) + call s:setup_commands(a:cchar) + + " Quickfix buffer should be reused across closing and opening a quickfix + " window + Xexpr "F1:10:Line10" + Xopen + let qfbnum = bufnr('') + Xclose + " Even after the quickfix window is closed, the buffer should be loaded + call assert_true(bufloaded(qfbnum)) + Xopen + " Buffer should be reused when opening the window again + call assert_equal(qfbnum, bufnr('')) + Xclose + + if a:cchar == 'l' + %bwipe + " For a location list, when both the file window and the location list + " window for the list are closed, then the buffer should be freed. + new | only + lexpr "F1:10:Line10" + let wid = win_getid() + lopen + let qfbnum = bufnr('') + call assert_match(qfbnum . ' %a- "\[Location List]"', execute('ls')) + close + " When the location list window is closed, the buffer name should not + " change to 'Quickfix List' + call assert_match(qfbnum . ' h- "\[Location List]"', execute('ls')) + call assert_true(bufloaded(qfbnum)) + + new | only + call assert_false(bufloaded(qfbnum)) + endif +endfunc + +func Test_qfbuf() + call Xqfbuf_test('c') + call Xqfbuf_test('l') +endfunc + " Test to make sure that an empty quickfix buffer is not reused for loading " a normal buffer. func Test_empty_qfbuf() |