diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-06-14 21:57:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 21:57:08 +0800 |
commit | 8ba64dd3ad1822efd6f986349e99f5f85afd7be7 (patch) | |
tree | 66b2987707cf6616614fb251d7e342ccdfd96c28 /src/nvim/lua/executor.c | |
parent | 2a2fb8be74f9147773416be63334ea6a74c66869 (diff) | |
parent | 0a0cda95286bf62fbce2776a0c0081cea39a88a8 (diff) | |
download | rneovim-8ba64dd3ad1822efd6f986349e99f5f85afd7be7.tar.gz rneovim-8ba64dd3ad1822efd6f986349e99f5f85afd7be7.tar.bz2 rneovim-8ba64dd3ad1822efd6f986349e99f5f85afd7be7.zip |
Merge pull request #18947 from zeertzjq/vim-8.2.1897
vim-patch:8.2.{1897,1898,5088}
Diffstat (limited to 'src/nvim/lua/executor.c')
-rw-r--r-- | src/nvim/lua/executor.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/nvim/lua/executor.c b/src/nvim/lua/executor.c index 215aae9430..30ae274607 100644 --- a/src/nvim/lua/executor.c +++ b/src/nvim/lua/executor.c @@ -1918,55 +1918,55 @@ int nlua_do_ucmd(ucmd_T *cmd, exarg_T *eap, bool preview) lua_newtable(lstate); // smods table - lua_pushinteger(lstate, cmdmod.tab); + lua_pushinteger(lstate, cmdmod.cmod_tab); lua_setfield(lstate, -2, "tab"); - lua_pushinteger(lstate, eap->verbose_save != -1 ? p_verbose : -1); + lua_pushinteger(lstate, cmdmod.cmod_verbose - 1); lua_setfield(lstate, -2, "verbose"); - if (cmdmod.split & WSP_ABOVE) { + if (cmdmod.cmod_split & WSP_ABOVE) { lua_pushstring(lstate, "aboveleft"); - } else if (cmdmod.split & WSP_BELOW) { + } else if (cmdmod.cmod_split & WSP_BELOW) { lua_pushstring(lstate, "belowright"); - } else if (cmdmod.split & WSP_TOP) { + } else if (cmdmod.cmod_split & WSP_TOP) { lua_pushstring(lstate, "topleft"); - } else if (cmdmod.split & WSP_BOT) { + } else if (cmdmod.cmod_split & WSP_BOT) { lua_pushstring(lstate, "botright"); } else { lua_pushstring(lstate, ""); } lua_setfield(lstate, -2, "split"); - lua_pushboolean(lstate, cmdmod.split & WSP_VERT); + lua_pushboolean(lstate, cmdmod.cmod_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 { - bool *set; + int flag; char *name; } mod_entry_T; static mod_entry_T mod_entries[] = { - { &cmdmod.browse, "browse" }, - { &cmdmod.confirm, "confirm" }, - { &cmdmod.hide, "hide" }, - { &cmdmod.keepalt, "keepalt" }, - { &cmdmod.keepjumps, "keepjumps" }, - { &cmdmod.keepmarks, "keepmarks" }, - { &cmdmod.keeppatterns, "keeppatterns" }, - { &cmdmod.lockmarks, "lockmarks" }, - { &cmdmod.noswapfile, "noswapfile" } + { CMOD_BROWSE, "browse" }, + { CMOD_CONFIRM, "confirm" }, + { CMOD_HIDE, "hide" }, + { CMOD_KEEPALT, "keepalt" }, + { CMOD_KEEPJUMPS, "keepjumps" }, + { CMOD_KEEPMARKS, "keepmarks" }, + { CMOD_KEEPPATTERNS, "keeppatterns" }, + { CMOD_LOCKMARKS, "lockmarks" }, + { CMOD_NOSWAPFILE, "noswapfile" } }; // The modifiers that are simple flags for (size_t i = 0; i < ARRAY_SIZE(mod_entries); i++) { - lua_pushboolean(lstate, *mod_entries[i].set); + lua_pushboolean(lstate, cmdmod.cmod_flags & mod_entries[i].flag); lua_setfield(lstate, -2, mod_entries[i].name); } |