call assert_equal('silent!', g:mods)
tab MyCmd
call assert_equal('tab', g:mods)
+ 0tab MyCmd
+ call assert_equal('0tab', g:mods)
+ tab split
+ tab MyCmd
+ call assert_equal('tab', g:mods)
+ 1tab MyCmd
+ call assert_equal('1tab', g:mods)
+ tabprev
+ tab MyCmd
+ call assert_equal('tab', g:mods)
+ 2tab MyCmd
+ call assert_equal('2tab', g:mods)
+ 2tabclose
topleft MyCmd
call assert_equal('topleft', g:mods)
to MyCmd
// :tab
if (cmod->cmod_tab > 0)
- result += add_cmd_modifier(buf, "tab", multi_mods);
+ {
+ int tabnr = cmod->cmod_tab - 1;
+
+ if (tabnr == tabpage_index(curtab))
+ {
+ // For compatibility, don't add a tabpage number if it is the same
+ // as the default number for :tab.
+ result += add_cmd_modifier(buf, "tab", multi_mods);
+ }
+ else
+ {
+ char tab_buf[NUMBUFLEN + 3];
+
+ sprintf(tab_buf, "%dtab", tabnr);
+ result += add_cmd_modifier(buf, tab_buf, multi_mods);
+ }
+ }
+
// :topleft
if (cmod->cmod_split & WSP_TOP)
result += add_cmd_modifier(buf, "topleft", multi_mods);