summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2013-02-26 19:36:15 +0100
committerBram Moolenaar <bram@vim.org>2013-02-26 19:36:15 +0100
commit3441f203d9f0ba859461da1135b89241bcf4e85b (patch)
tree7a18d555c59f65bda725e8e3c3ffec02d1689344
parent6c43bc4055a15694131c967b729fa0668607d25d (diff)
downloadvim-3441f203d9f0ba859461da1135b89241bcf4e85b.tar.gz
updated for version 7.3.841v7.3.841v7-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)
-rw-r--r--src/eval.c10
-rw-r--r--src/version.c2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index 480f214b..d5a41fbc 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -5164,6 +5164,16 @@ eval7(arg, rettv, evaluate, want_string)
ret = get_func_tv(s, len, rettv, arg,
curwin->w_cursor.lnum, curwin->w_cursor.lnum,
&len, evaluate, NULL);
+
+ /* If evaluate is FALSE rettv->v_type was not set in
+ * get_func_tv, but it's needed in handle_subscript() to parse
+ * what follows. So set it here. */
+ if (rettv->v_type == VAR_UNKNOWN && !evaluate && **arg == '(')
+ {
+ rettv->vval.v_string = vim_strsave("");
+ rettv->v_type = VAR_FUNC;
+ }
+
/* Stop the expression evaluation when immediately
* aborting on error, or when an interrupt occurred or
* an exception was thrown but not caught. */
diff --git a/src/version.c b/src/version.c
index 7c12188f..6098591c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 841,
+/**/
840,
/**/
839,