diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-10 10:52:24 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-10-10 15:28:06 -0400 |
| commit | 0e056d4a062a3586938382128f3657b00c5d2e69 (patch) | |
| tree | 95a037dfe76f936238be05ea3aa9a56a4f61b7db /src/nvim/testdir | |
| parent | f7cc3ae0b7b8ce67294c00729d278362ad60a4f0 (diff) | |
| download | rneovim-0e056d4a062a3586938382128f3657b00c5d2e69.tar.gz rneovim-0e056d4a062a3586938382128f3657b00c5d2e69.tar.bz2 rneovim-0e056d4a062a3586938382128f3657b00c5d2e69.zip | |
vim-patch:8.1.0523: opening window from quickfix leaves empty buffer behind
Problem: Opening window from quickfix leaves empty buffer behind.
Solution: Add qf_jump_newwin(). (Yegappan Lakshmanan, closes vim/vim#2574)
https://github.com/vim/vim/commit/b244373becbec124bee20dbbfd05365586cda8cd
Close https://github.com/neovim/neovim/pull/12855
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim index 4090db2874..4e04ea161f 100644 --- a/src/nvim/testdir/test_quickfix.vim +++ b/src/nvim/testdir/test_quickfix.vim @@ -3869,6 +3869,52 @@ func Test_curswant() cclose | helpclose endfunc +" Test for opening a file from the quickfix window using CTRL-W <Enter> +" doesn't leave an empty buffer around. +func Test_splitview() + call s:create_test_file('Xtestfile1') + call s:create_test_file('Xtestfile2') + new | only + let last_bufnr = bufnr('Test_sv_1', 1) + let l = ['Xtestfile1:2:Line2', 'Xtestfile2:4:Line4'] + cgetexpr l + copen + let numbufs = len(getbufinfo()) + exe "normal \<C-W>\<CR>" + copen + exe "normal j\<C-W>\<CR>" + " Make sure new empty buffers are not created + call assert_equal(numbufs, len(getbufinfo())) + " Creating a new buffer should use the next available buffer number + call assert_equal(last_bufnr + 4, bufnr("Test_sv_2", 1)) + bwipe Test_sv_1 + bwipe Test_sv_2 + new | only + + " When split opening files from location list window, make sure that two + " windows doesn't refer to the same location list + lgetexpr l + let locid = getloclist(0, {'id' : 0}).id + lopen + exe "normal \<C-W>\<CR>" + call assert_notequal(locid, getloclist(0, {'id' : 0}).id) + call assert_equal(0, getloclist(0, {'winid' : 0}).winid) + new | only + + " When split opening files from a helpgrep location list window, a new help + " window should be opend with a copy of the location list. + lhelpgrep window + let locid = getloclist(0, {'id' : 0}).id + lwindow + exe "normal j\<C-W>\<CR>" + call assert_notequal(locid, getloclist(0, {'id' : 0}).id) + call assert_equal(0, getloclist(0, {'winid' : 0}).winid) + new | only + + call delete('Xtestfile1') + call delete('Xtestfile2') +endfunc + " Test for parsing entries using visual screen column func Test_viscol() enew |