aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-05-05 20:48:25 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-05-06 07:47:43 +0800
commitad7f9a701cf25f598cb8ee3d05ad0604fa9a9a65 (patch)
tree659e3add44e7ddcc773e01818155ca7ffb98489d /src
parentaa5f3a7962c3b96d1a939a83bf2dacad72d8e898 (diff)
downloadrneovim-ad7f9a701cf25f598cb8ee3d05ad0604fa9a9a65.tar.gz
rneovim-ad7f9a701cf25f598cb8ee3d05ad0604fa9a9a65.tar.bz2
rneovim-ad7f9a701cf25f598cb8ee3d05ad0604fa9a9a65.zip
vim-patch:8.2.2141: a user command with try/catch may not catch an expression error
Problem: A user command with try/catch may not catch an expression error. Solution: When an expression fails check for following "|". (closes vim/vim#7469) https://github.com/vim/vim/commit/8143a53c533bc7776c57e5db063d185bdd5750f3 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index c6a6ef6848..f638b90caa 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -2369,7 +2369,11 @@ int eval0(char *arg, typval_T *rettv, exarg_T *eap, evalarg_T *const evalarg)
}
// Some of the expression may not have been consumed. Do not check for
- // a next command to avoid more errors.
+ // a next command to avoid more errors, unless "|" is following, which
+ // could only be a command separator.
+ if (eap != NULL && skipwhite(p)[0] == '|' && skipwhite(p)[1] != '|') {
+ eap->nextcmd = check_nextcmd(p);
+ }
return FAIL;
}