mirror of
https://github.com/vim/vim.git
synced 2025-12-10 18:46:57 -05:00
patch 9.1.1961: :0tab behaves like :tab for :stag when 'swb' contains "newtab"
Problem: :0tab behaves like :tab for :stag when 'switchbuf' contains
"newtab" (after 9.1.1949).
Solution: Don't override cmod_tab if it's already non-zero (zeertzjq).
closes: #18859
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
7a0d0a022a
commit
2b3566d89e
@ -3855,7 +3855,7 @@ jumpto_tag(
|
|||||||
// split window.
|
// split window.
|
||||||
cmdmod.cmod_split |= WSP_VERT;
|
cmdmod.cmod_split |= WSP_VERT;
|
||||||
|
|
||||||
if (swb_flags & SWB_NEWTAB)
|
if ((swb_flags & SWB_NEWTAB) && cmdmod.cmod_tab == 0)
|
||||||
// If 'switchbuf' contains 'newtab', then use a new tabpage
|
// If 'switchbuf' contains 'newtab', then use a new tabpage
|
||||||
cmdmod.cmod_tab = tabpage_index(curtab) + 1;
|
cmdmod.cmod_tab = tabpage_index(curtab) + 1;
|
||||||
|
|
||||||
|
|||||||
@ -162,7 +162,12 @@ func Test_tagjump_switchbuf()
|
|||||||
call assert_equal(2, tabpagenr('$'))
|
call assert_equal(2, tabpagenr('$'))
|
||||||
call assert_equal(2, tabpagenr())
|
call assert_equal(2, tabpagenr())
|
||||||
call assert_equal(2, line('.'))
|
call assert_equal(2, line('.'))
|
||||||
|
0tab stag third
|
||||||
|
call assert_equal(3, tabpagenr('$'))
|
||||||
|
call assert_equal(1, tabpagenr())
|
||||||
|
call assert_equal(3, line('.'))
|
||||||
|
|
||||||
|
tabclose!
|
||||||
tabclose!
|
tabclose!
|
||||||
enew | only
|
enew | only
|
||||||
set tags&
|
set tags&
|
||||||
|
|||||||
@ -729,6 +729,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1961,
|
||||||
/**/
|
/**/
|
||||||
1960,
|
1960,
|
||||||
/**/
|
/**/
|
||||||
|
|||||||
Reference in New Issue
Block a user