aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/command.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-06-13 17:13:46 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-06-14 20:58:34 +0800
commitda41ca299f52d4e08a34344359c250a3058fd3c6 (patch)
treea934520f470634491186c118d4a64a0a414aaa72 /src/nvim/api/command.c
parentcd9e08cb94663558891fdd46dfa58f662e947be5 (diff)
downloadrneovim-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/api/command.c')
-rw-r--r--src/nvim/api/command.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nvim/api/command.c b/src/nvim/api/command.c
index a7115c09a3..26aa26004f 100644
--- a/src/nvim/api/command.c
+++ b/src/nvim/api/command.c
@@ -284,8 +284,6 @@ String nvim_cmd(uint64_t channel_id, Dict(cmd) *cmd, Dict(cmd_opts) *opts, Error
{
exarg_T ea;
memset(&ea, 0, sizeof(ea));
- ea.verbose_save = -1;
- ea.save_msg_silent = -1;
CmdParseInfo cmdinfo;
memset(&cmdinfo, 0, sizeof(cmdinfo));
@@ -514,9 +512,9 @@ String nvim_cmd(uint64_t channel_id, Dict(cmd) *cmd, Dict(cmd_opts) *opts, Error
if (HAS_KEY(mods.verbose)) {
if (mods.verbose.type != kObjectTypeInteger) {
VALIDATION_ERROR("'mods.verbose' must be a Integer");
- } else if (mods.verbose.data.integer >= 0) {
+ } else if ((int)mods.verbose.data.integer >= 0) {
// Silently ignore negative integers to allow mods.verbose to be set to -1.
- cmdinfo.verbose = mods.verbose.data.integer;
+ cmdinfo.verbose = (int)mods.verbose.data.integer;
}
}
@@ -662,7 +660,7 @@ static void build_cmdline_str(char **cmdlinep, exarg_T *eap, CmdParseInfo *cmdin
kv_printf(cmdline, "%dtab ", cmdinfo->cmdmod.tab - 1);
}
if (cmdinfo->verbose != -1) {
- kv_printf(cmdline, "%ldverbose ", cmdinfo->verbose);
+ kv_printf(cmdline, "%dverbose ", cmdinfo->verbose);
}
if (cmdinfo->emsg_silent) {