From 4c8376a8768919383467228480d27152cb808540 Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Tue, 13 Jun 2023 18:04:59 +0600 Subject: [PATCH] fix(api): redundant error when using `nvim_cmd` `nvim_cmd` shows multiple errors when attempting to edit another buffer through a command when `curbuf->b_ro_locked` is set. This PR fixes that by removing a redundant error in `execute_cmd`. (cherry picked from commit 3e6af308882ecc7dbf0d6538a047fbfdb465a3eb) --- src/nvim/ex_docmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 1be8ca0b0b..848e0f3e93 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -1676,7 +1676,7 @@ int execute_cmd(exarg_T *eap, CmdParseInfo *cmdinfo, bool preview) && !(eap->cmdidx == CMD_file && *eap->arg == NUL) && !IS_USER_CMDIDX(eap->cmdidx) && curbuf_locked()) { - ERROR(_(e_cannot_edit_other_buf)); + goto end; } correct_range(eap);