mirror of
https://github.com/vim/vim.git
synced 2025-09-24 03:44:06 -04:00
patch 9.0.1508: catch does not work when lines are joined with a newline
Problem: Catch does not work when lines are joined with a newline. Solution: Set "nextcmd" appropriately. (closes #12348)
This commit is contained in:
15
src/eval.c
15
src/eval.c
@@ -2699,12 +2699,15 @@ eval0_retarg(
|
||||
semsg(_(e_invalid_expression_str), arg);
|
||||
}
|
||||
|
||||
// Some of the expression may not have been consumed. Do not check for
|
||||
// a next command to avoid more errors, unless "|" is following, which
|
||||
// could only be a command separator.
|
||||
if (eap != NULL && p != NULL
|
||||
&& skipwhite(p)[0] == '|' && skipwhite(p)[1] != '|')
|
||||
eap->nextcmd = check_nextcmd(p);
|
||||
if (eap != NULL && p != NULL)
|
||||
{
|
||||
// Some of the expression may not have been consumed.
|
||||
// Only execute a next command if it cannot be a "||" operator.
|
||||
// The next command may be "catch".
|
||||
char_u *nextcmd = check_nextcmd(p);
|
||||
if (nextcmd != NULL && *nextcmd != '|')
|
||||
eap->nextcmd = nextcmd;
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user