mirror of
https://github.com/vim/vim.git
synced 2025-12-10 18:46:57 -05:00
patch 9.1.1949: :stag does not use 'swichtbuf' option
Problem: :stag does not use 'swichtbuf' option, though the
documentation states differently
(Christian Brabandt)
Solution: Respect 'switchbuf' option (Yegappan Lakshmanan).
related: #18845
closes: #18856
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
2d54d9934d
commit
efc7509be2
@ -3850,6 +3850,15 @@ jumpto_tag(
|
||||
if (getfile_result == GETFILE_UNUSED
|
||||
&& (postponed_split || cmdmod.cmod_tab != 0))
|
||||
{
|
||||
if (swb_flags & SWB_VSPLIT)
|
||||
// If 'switchbuf' contains 'vsplit', then use a new vertically
|
||||
// split window.
|
||||
cmdmod.cmod_split |= WSP_VERT;
|
||||
|
||||
if (swb_flags & SWB_NEWTAB)
|
||||
// If 'switchbuf' contains 'newtab', then use a new tabpage
|
||||
cmdmod.cmod_tab = tabpage_index(curtab) + 1;
|
||||
|
||||
if (win_split(postponed_split > 0 ? postponed_split : 0,
|
||||
postponed_split_flags) == FAIL)
|
||||
{
|
||||
|
||||
@ -144,6 +144,24 @@ func Test_tagjump_switchbuf()
|
||||
1tabnext | stag third
|
||||
call assert_equal(2, tabpagenr('$'))
|
||||
call assert_equal(3, line('.'))
|
||||
tabonly
|
||||
|
||||
" use a vertically split window
|
||||
enew | only
|
||||
set switchbuf=vsplit
|
||||
stag third
|
||||
call assert_equal(2, winnr('$'))
|
||||
call assert_equal(1, winnr())
|
||||
call assert_equal(3, line('.'))
|
||||
call assert_equal(['row', [['leaf', win_getid(1)], ['leaf', win_getid(2)]]], winlayout())
|
||||
|
||||
" jump to a tag in a new tabpage
|
||||
enew | only
|
||||
set switchbuf=newtab
|
||||
stag second
|
||||
call assert_equal(2, tabpagenr('$'))
|
||||
call assert_equal(2, tabpagenr())
|
||||
call assert_equal(2, line('.'))
|
||||
|
||||
tabclose!
|
||||
enew | only
|
||||
|
||||
@ -729,6 +729,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1949,
|
||||
/**/
|
||||
1948,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user