Problem: Vim9: a variable name with "->" in the next line doesn't work.
Solution: Recognize a variable name by itself. (closes #7770)
return eap->cmd;
}
}
+
+ // If it is an ID it might be a variable with an operator on the next
+ // line, if the variable exists it can't be an Ex command.
+ if (p > eap->cmd && ends_excmd(*skipwhite(p))
+ && (lookup(eap->cmd, p - eap->cmd, NULL, cctx) == OK
+ || (ASCII_ISALPHA(eap->cmd[0]) && eap->cmd[1] == ':')))
+ {
+ eap->cmdidx = CMD_eval;
+ return eap->cmd;
+ }
}
#endif
assert_equal([1, 2, 3], res)
END
CheckScriptSuccess(lines)
+
+ lines =<< trim END
+ new
+ var name = [1, 2]
+ name
+ ->copy()
+ ->setline(1)
+ assert_equal(['1', '2'], getline(1, 2))
+ bwipe!
+ END
+ CheckDefAndScriptSuccess(lines)
+
+ lines =<< trim END
+ new
+ g:shortlist
+ ->copy()
+ ->setline(1)
+ assert_equal(['1', '2'], getline(1, 2))
+ bwipe!
+ END
+ g:shortlist = [1, 2]
+ CheckDefAndScriptSuccess(lines)
+ unlet g:shortlist
enddef
def Test_method_call_whitespace()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2453,
/**/
2452,
/**/