Skip to content

Commit a2be532

Browse files
committed
updated for version 7.3.841
Problem: When a "cond ? one : two" expression has a subscript it is not parsed correctly. (Andy Wokula) Solution: Handle a subscript also when the type is unknown. (Christian Brabandt)
1 parent 36f8f31 commit a2be532

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/eval.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5164,6 +5164,16 @@ eval7(arg, rettv, evaluate, want_string)
51645164
ret = get_func_tv(s, len, rettv, arg,
51655165
curwin->w_cursor.lnum, curwin->w_cursor.lnum,
51665166
&len, evaluate, NULL);
5167+
5168+
/* If evaluate is FALSE rettv->v_type was not set in
5169+
* get_func_tv, but it's needed in handle_subscript() to parse
5170+
* what follows. So set it here. */
5171+
if (rettv->v_type == VAR_UNKNOWN && !evaluate && **arg == '(')
5172+
{
5173+
rettv->vval.v_string = vim_strsave("");
5174+
rettv->v_type = VAR_FUNC;
5175+
}
5176+
51675177
/* Stop the expression evaluation when immediately
51685178
* aborting on error, or when an interrupt occurred or
51695179
* an exception was thrown but not caught. */

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,8 @@ static char *(features[]) =
728728

729729
static int included_patches[] =
730730
{ /* Add new patch number below this line */
731+
/**/
732+
841,
731733
/**/
732734
840,
733735
/**/

0 commit comments

Comments
 (0)