Mercurial > vim
comparison src/testdir/test_quickfix.vim @ 15024:3a3c9b638187 v8.1.0523
patch 8.1.0523: opening window from quickfix leaves empty buffer behind
commit https://github.com/vim/vim/commit/b244373becbec124bee20dbbfd05365586cda8cd
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 11 22:50:27 2018 +0100
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 https://github.com/vim/vim/issues/2574)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 11 Nov 2018 23:00:05 +0100 |
parents | 676db1b7fc35 |
children | a413374825dd |
comparison
equal
deleted
inserted
replaced
15023:c6fe8685e092 | 15024:3a3c9b638187 |
---|---|
3716 normal! llll | 3716 normal! llll |
3717 1cc | 3717 1cc |
3718 call assert_equal(getcurpos()[4], virtcol('.')) | 3718 call assert_equal(getcurpos()[4], virtcol('.')) |
3719 cclose | helpclose | 3719 cclose | helpclose |
3720 endfunc | 3720 endfunc |
3721 | |
3722 " Test for opening a file from the quickfix window using CTRL-W <Enter> | |
3723 " doesn't leave an empty buffer around. | |
3724 func Test_splitview() | |
3725 call s:create_test_file('Xtestfile1') | |
3726 call s:create_test_file('Xtestfile2') | |
3727 new | only | |
3728 let last_bufnr = bufnr('Test_sv_1', 1) | |
3729 let l = ['Xtestfile1:2:Line2', 'Xtestfile2:4:Line4'] | |
3730 cgetexpr l | |
3731 copen | |
3732 let numbufs = len(getbufinfo()) | |
3733 exe "normal \<C-W>\<CR>" | |
3734 copen | |
3735 exe "normal j\<C-W>\<CR>" | |
3736 " Make sure new empty buffers are not created | |
3737 call assert_equal(numbufs, len(getbufinfo())) | |
3738 " Creating a new buffer should use the next available buffer number | |
3739 call assert_equal(last_bufnr + 4, bufnr("Test_sv_2", 1)) | |
3740 bwipe Test_sv_1 | |
3741 bwipe Test_sv_2 | |
3742 new | only | |
3743 | |
3744 " When split opening files from location list window, make sure that two | |
3745 " windows doesn't refer to the same location list | |
3746 lgetexpr l | |
3747 let locid = getloclist(0, {'id' : 0}).id | |
3748 lopen | |
3749 exe "normal \<C-W>\<CR>" | |
3750 call assert_notequal(locid, getloclist(0, {'id' : 0}).id) | |
3751 call assert_equal(0, getloclist(0, {'winid' : 0}).winid) | |
3752 new | only | |
3753 | |
3754 " When split opening files from a helpgrep location list window, a new help | |
3755 " window should be opend with a copy of the location list. | |
3756 lhelpgrep window | |
3757 let locid = getloclist(0, {'id' : 0}).id | |
3758 lwindow | |
3759 exe "normal j\<C-W>\<CR>" | |
3760 call assert_notequal(locid, getloclist(0, {'id' : 0}).id) | |
3761 call assert_equal(0, getloclist(0, {'winid' : 0}).winid) | |
3762 new | only | |
3763 | |
3764 call delete('Xtestfile1') | |
3765 call delete('Xtestfile2') | |
3766 endfunc |