1
0
forked from aniani/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 #7469)
This commit is contained in:
Bram Moolenaar
2020-12-13 20:26:29 +01:00
parent 2a3cd3af45
commit 8143a53c53
4 changed files with 34 additions and 4 deletions

View File

@@ -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;
}