patch 8.2.2242: Vim9: bar line continuation does not work at script level
Problem: Vim9: line continuation with bar does not work at script level.
Solution: Check for Vim9 script.
diff --git a/src/scriptfile.c b/src/scriptfile.c
index eceefd7..adc5caf 100644
--- a/src/scriptfile.c
+++ b/src/scriptfile.c
@@ -1741,8 +1741,8 @@
char_u *p;
int do_vim9_all = in_vim9script()
&& options == GETLINE_CONCAT_ALL;
- int do_vim9_cont = do_vim9_all
- || options == GETLINE_CONCAT_CONTDEF;
+ int do_bar_cont = do_vim9_all
+ || options == GETLINE_CONCAT_CONTBAR;
#ifdef FEAT_EVAL
// If breakpoints have been added/deleted need to check for it.
@@ -1797,7 +1797,7 @@
|| (p[0] == '"' && p[1] == '\\' && p[2] == ' ')
|| (do_vim9_all && (*p == NUL
|| vim9_comment_start(p)))
- || (do_vim9_cont && p[0] == '|' && p[1] != '|')))
+ || (do_bar_cont && p[0] == '|' && p[1] != '|')))
{
garray_T ga;
@@ -1817,7 +1817,7 @@
if (sp->nextline == NULL)
break;
p = skipwhite(sp->nextline);
- if (*p == '\\' || (do_vim9_cont && p[0] == '|' && p[1] != '|'))
+ if (*p == '\\' || (do_bar_cont && p[0] == '|' && p[1] != '|'))
{
// Adjust the growsize to the current length to speed up
// concatenating many lines.