summaryrefslogtreecommitdiff
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-13 20:26:29 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-13 20:26:29 +0100
commit8143a53c533bc7776c57e5db063d185bdd5750f3 (patch)
treec23aa28ab84809e57264cf8c98e3cce8197f8a78 /src/eval.c
parent2a3cd3af455973d678f70303ebdd486f3478bc0d (diff)
downloadvim-git-8.2.2141.tar.gz
patch 8.2.2141: a user command with try/catch may not catch an expression errorv8.2.2141
Problem: A user command with try/catch may not catch an expression error. Solution: When an expression fails check for following "|". (closes #7469)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c
index 47aaaad23..6ce2ebf68 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -2158,7 +2158,10 @@ eval0(
semsg(_(e_invexpr2), arg);
// 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;
}