fix: make nvim_cmd not suppress errors inside key mapping

Closes #18632
This commit is contained in:
Famiu Haque
2022-05-19 21:49:12 +06:00
parent 95580f31b3
commit fb8fa004d8
3 changed files with 35 additions and 17 deletions

View File

@@ -1304,21 +1304,24 @@ 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;
}