patch 8.2.1433: Vim9: cannot mingle comments in multi-line lambda
Problem: Vim9: cannot mingle comments in multi-line lambda.
Solution: Skip over NULL lines. (closes #6694)
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 8b58d96..87bb0e2 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1729,11 +1729,13 @@
char_u *line = ((char_u **)cctx->ctx_ufunc->uf_lines.ga_data)[lnum];
char_u *p;
- if (line == NULL)
- break;
- p = skipwhite(line);
- if (*p != NUL && !vim9_comment_start(p))
- return p;
+ // ignore NULLs inserted for continuation lines
+ if (line != NULL)
+ {
+ p = skipwhite(line);
+ if (*p != NUL && !vim9_comment_start(p))
+ return p;
+ }
}
return NULL;
}