diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-06-13 17:13:46 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-06-14 20:58:34 +0800 |
commit | da41ca299f52d4e08a34344359c250a3058fd3c6 (patch) | |
tree | a934520f470634491186c118d4a64a0a414aaa72 /src/nvim/lua/executor.c | |
parent | cd9e08cb94663558891fdd46dfa58f662e947be5 (diff) | |
download | rneovim-da41ca299f52d4e08a34344359c250a3058fd3c6.tar.gz rneovim-da41ca299f52d4e08a34344359c250a3058fd3c6.tar.bz2 rneovim-da41ca299f52d4e08a34344359c250a3058fd3c6.zip |
vim-patch:8.2.1897: command modifiers are saved and set inconsistently
Problem: Command modifiers are saved and set inconsistently.
Solution: Separate parsing and applying command modifiers. Save values in
cmdmod_T.
https://github.com/vim/vim/commit/5661ed6c833e05467cab33cb9b1c535e7e5cc570
Cherry-pick: :0verbose fix from patch 8.2.4741
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index bd06123d5f..ac68c02d8b 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -1920,7 +1920,9 @@ int nlua_do_ucmd(ucmd_T *cmd, exarg_T *eap, bool preview) lua_pushinteger(lstate, cmdmod.tab); lua_setfield(lstate, -2, "tab"); - lua_pushinteger(lstate, eap->verbose_save != -1 ? p_verbose : -1); + lua_pushinteger(lstate, (cmdmod.cmod_verbose != 0 + ? cmdmod.cmod_verbose < 0 ? 0 : cmdmod.cmod_verbose + : -1)); lua_setfield(lstate, -2, "verbose"); if (cmdmod.split & WSP_ABOVE) { @@ -1938,13 +1940,13 @@ int nlua_do_ucmd(ucmd_T *cmd, exarg_T *eap, bool preview) lua_pushboolean(lstate, cmdmod.split & WSP_VERT); lua_setfield(lstate, -2, "vertical"); - lua_pushboolean(lstate, eap->save_msg_silent != -1 ? (msg_silent != 0) : 0); + lua_pushboolean(lstate, cmdmod.cmod_flags & CMOD_SILENT); lua_setfield(lstate, -2, "silent"); - lua_pushboolean(lstate, eap->did_esilent); + lua_pushboolean(lstate, cmdmod.cmod_flags & CMOD_ERRSILENT); lua_setfield(lstate, -2, "emsg_silent"); - lua_pushboolean(lstate, eap->did_sandbox); + lua_pushboolean(lstate, cmdmod.cmod_flags & CMOD_SANDBOX); lua_setfield(lstate, -2, "sandbox"); - lua_pushboolean(lstate, cmdmod.save_ei != NULL); + lua_pushboolean(lstate, cmdmod.cmod_flags & CMOD_NOAUTOCMD); lua_setfield(lstate, -2, "noautocmd"); typedef struct { |