mirror of
https://github.com/neovim/neovim.git
synced 2026-07-14 05:10:36 +00:00
vim-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: vim/vim#18859
2b3566d89e
This commit is contained in:
@@ -2869,7 +2869,7 @@ static int jumpto_tag(const char *lbuf_arg, int forceit, bool keep_help)
|
|||||||
cmdmod.cmod_split |= WSP_VERT;
|
cmdmod.cmod_split |= WSP_VERT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (swb_flags & kOptSwbFlagNewtab) {
|
if ((swb_flags & kOptSwbFlagNewtab) && 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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,7 +163,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&
|
||||||
|
|||||||
Reference in New Issue
Block a user