diff options
author | bfredl <bjorn.linse@gmail.com> | 2022-05-20 14:22:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-20 14:22:44 +0200 |
commit | 1d160a76ec46e7eb4cfa627fb85987059fae55c4 (patch) | |
tree | a4b9e2aa2303970ea1af9012ea07704ab03de413 /src/nvim/api/vimscript.c | |
parent | a4862cbb5fe4fb368a679adf198506a56a104413 (diff) | |
parent | fb8fa004d8c91b7b591509539a228e97ebc57d9d (diff) | |
download | rneovim-1d160a76ec46e7eb4cfa627fb85987059fae55c4.tar.gz rneovim-1d160a76ec46e7eb4cfa627fb85987059fae55c4.tar.bz2 rneovim-1d160a76ec46e7eb4cfa627fb85987059fae55c4.zip |
Merge pull request #18641 from famiu/fix/nvim_cmd/keymap_error_suppress
fix: make `nvim_cmd` not suppress errors inside key mapping
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; |