diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-03 21:17:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-03 21:17:03 +0800 |
commit | 0313aba77a447558c3b373370b60eb78067e1c4d (patch) | |
tree | eeecce077c2d1e1e38e6a8d9e262c013e421c514 /src/nvim/ex_docmd.c | |
parent | e837f29ce6c7784340ae2cd866aa239462d3920c (diff) | |
download | rneovim-0313aba77a447558c3b373370b60eb78067e1c4d.tar.gz rneovim-0313aba77a447558c3b373370b60eb78067e1c4d.tar.bz2 rneovim-0313aba77a447558c3b373370b60eb78067e1c4d.zip |
vim-patch:9.0.0031: <mods> of user command does not have correct verbose value (#19215)
vim-patch:9.0.0031: <mods> of user command does not have correct verbose value
Problem: <mods> of user command does not have correct verbose value.
Solution: Use the value from the command modifier. (closes vim/vim#10651)
https://github.com/vim/vim/commit/9359e8a6d99fe2abfcbb9603339f1740d8870cc6
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index f992badc5e..43d57cb278 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -6567,20 +6567,27 @@ size_t uc_mods(char *buf, const cmdmod_T *cmod, bool quote) // the modifiers that are simple flags for (size_t i = 0; i < ARRAY_SIZE(mod_entries); i++) { - if (cmdmod.cmod_flags & mod_entries[i].flag) { + if (cmod->cmod_flags & mod_entries[i].flag) { result += add_cmd_modifier(buf, mod_entries[i].name, &multi_mods); } } // :silent - if (msg_silent > 0) { + if (cmod->cmod_flags & CMOD_SILENT) { result += add_cmd_modifier(buf, (cmod->cmod_flags & CMOD_ERRSILENT) ? "silent!" : "silent", &multi_mods); } // :verbose - if (p_verbose > 0) { - result += add_cmd_modifier(buf, "verbose", &multi_mods); + if (cmod->cmod_verbose > 0) { + int verbose_value = cmod->cmod_verbose - 1; + if (verbose_value == 1) { + result += add_cmd_modifier(buf, "verbose", &multi_mods); + } else { + char verbose_buf[NUMBUFLEN]; + snprintf(verbose_buf, NUMBUFLEN, "%dverbose", verbose_value); + result += add_cmd_modifier(buf, verbose_buf, &multi_mods); + } } // flags from cmod->cmod_split result += add_win_cmd_modifers(buf, cmod, &multi_mods); |