vim-patch:8.2.5088: value of cmod_verbose is a bit complicated to use

Problem:    Value of cmod_verbose is a bit complicated to use.
Solution:   Use zero for not set, value + 1 when set. (closes vim/vim#10564)
cd7496382e

Omit has_cmdmod(): only used for Vim9 script
This commit is contained in:
zeertzjq
2022-06-14 20:46:18 +08:00
parent 6130b4a84b
commit 0a0cda9528
5 changed files with 22 additions and 37 deletions

View File

@@ -1920,9 +1920,7 @@ int nlua_do_ucmd(ucmd_T *cmd, exarg_T *eap, bool preview)
lua_pushinteger(lstate, cmdmod.cmod_tab);
lua_setfield(lstate, -2, "tab");
lua_pushinteger(lstate, (cmdmod.cmod_verbose != 0
? cmdmod.cmod_verbose < 0 ? 0 : cmdmod.cmod_verbose
: -1));
lua_pushinteger(lstate, cmdmod.cmod_verbose - 1);
lua_setfield(lstate, -2, "verbose");
if (cmdmod.cmod_split & WSP_ABOVE) {