fix(api)!: correctly deal with number before :tab

Now nvim_parse_cmd and nvim_create_user_command use a "tab" value which
is the same as the number passed before :tab modifier instead of the
number plus 1, and "tab" value is -1 if :tab modifier is not used.
This commit is contained in:
zeertzjq
2022-09-01 18:46:34 +08:00
parent 2afcdbd63a
commit 1ef7720567
6 changed files with 54 additions and 31 deletions

View File

@@ -2082,7 +2082,7 @@ int nlua_do_ucmd(ucmd_T *cmd, exarg_T *eap, bool preview)
lua_newtable(lstate); // smods table
lua_pushinteger(lstate, cmdmod.cmod_tab);
lua_pushinteger(lstate, cmdmod.cmod_tab - 1);
lua_setfield(lstate, -2, "tab");
lua_pushinteger(lstate, cmdmod.cmod_verbose - 1);