diff options
author | Famiu Haque <famiuhaque@protonmail.com> | 2022-05-19 21:49:12 +0600 |
---|---|---|
committer | Famiu Haque <famiuhaque@protonmail.com> | 2022-05-19 22:23:14 +0600 |
commit | fb8fa004d8c91b7b591509539a228e97ebc57d9d (patch) | |
tree | 708d2e84e6d76222889d0f41d0871d961fe78740 /src/nvim/api/vimscript.c | |
parent | 95580f31b384fddd162e0e1f6b7ed69b3e483ea1 (diff) | |
download | rneovim-fb8fa004d8c91b7b591509539a228e97ebc57d9d.tar.gz rneovim-fb8fa004d8c91b7b591509539a228e97ebc57d9d.tar.bz2 rneovim-fb8fa004d8c91b7b591509539a228e97ebc57d9d.zip |
fix: make `nvim_cmd` not suppress errors inside key mapping
Closes #18632
Diffstat (limited to 'src/nvim/api/vimscript.c')
-rw-r--r-- | src/nvim/api/vimscript.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c index b8f7b33cd5..e71f1a11ec 100644 --- a/src/nvim/api/vimscript.c +++ b/src/nvim/api/vimscript.c @@ -1304,20 +1304,23 @@ String nvim_cmd(uint64_t channel_id, Dict(cmd) *cmd, Dict(cmd_opts) *opts, Error capture_ga = &capture_local; } - try_start(); - if (output) { - msg_silent++; - } + TRY_WRAP({ + try_start(); + if (output) { + msg_silent++; + } - WITH_SCRIPT_CONTEXT(channel_id, { - execute_cmd(&ea, &cmdinfo); - }); + WITH_SCRIPT_CONTEXT(channel_id, { + execute_cmd(&ea, &cmdinfo); + }); - if (output) { - capture_ga = save_capture_ga; - msg_silent = save_msg_silent; - } - try_end(err); + if (output) { + capture_ga = save_capture_ga; + msg_silent = save_msg_silent; + } + + try_end(err); + }); if (ERROR_SET(err)) { goto clear_ga; |