int vim9script = in_vim9script();
garray_T *gap = &evalarg->eval_ga;
int save_flags = evalarg == NULL ? 0 : evalarg->eval_flags;
+ int evaluate = evalarg == NULL
+ ? FALSE : (evalarg->eval_flags & EVAL_EVALUATE);
- if (vim9script
+ if (vim9script && evaluate
&& (evalarg->eval_cookie != NULL || evalarg->eval_cctx != NULL))
{
ga_init2(gap, sizeof(char_u *), 10);
if (evalarg != NULL)
evalarg->eval_flags = save_flags;
- if (vim9script
+ if (vim9script && evaluate
&& (evalarg->eval_cookie != NULL || evalarg->eval_cctx != NULL))
{
if (evalarg->eval_ga.ga_len == 1)
&& (p[2] == '{' || ASCII_ISALPHA(p[2])))))
{
*arg = eval_next_line(evalarg);
+ p = *arg;
check_white = FALSE;
}
}
/*
- * Return the readahead line.
+ * Return the readahead line. Note that the pointer may become invalid when
+ * getting the next line, if it's concatenated with the next one.
*/
char_u *
source_nextline(void *cookie)
assert_equal(12, v)
END
CheckScriptSuccess(lines)
+
+ # nested lambda with line breaks
+ lines =<< trim END
+ vim9script
+ search('"', 'cW', 0, 0, {->
+ synstack('.', col('.'))
+ ->map({_, v -> synIDattr(v, 'name')})->len()})
+ END
+ CheckScriptSuccess(lines)
enddef
def Test_expr7_dict()