]> granicus.if.org Git - vim/commitdiff
patch 8.2.2925: Vim9: line continuation comment uses legacy syntax v8.2.2925
authorBram Moolenaar <Bram@vim.org>
Wed, 2 Jun 2021 13:28:15 +0000 (15:28 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 2 Jun 2021 13:28:15 +0000 (15:28 +0200)
Problem:    Vim9: line continuation comment uses legacy syntax.
Solution:   Check for #\ instead of "\. (closes #8295)

src/scriptfile.c
src/testdir/test_vim9_script.vim
src/version.c

index 203cad09fdd773196a04beb1e0c23403edee6df7..15338be63269e2e0b083f2aedb3061661dfe5a7f 100644 (file)
@@ -1842,7 +1842,8 @@ getsourceline(
                        ga_concat(&ga, p);
                    }
                }
-               else if (!(p[0] == '"' && p[1] == '\\' && p[2] == ' ')
+               else if (!(p[0] == (in_vim9script() ? '#' : '"')
+                                               && p[1] == '\\' && p[2] == ' ')
                     && !(do_vim9_all && (*p == NUL || vim9_comment_start(p))))
                    break;
                /* drop a # comment or "\ comment line */
index cdda6132187ac6728be175259224c02cf6c7e91c..ee324950fed58fd34ba6ba5a0a98427880dc2bea 100644 (file)
@@ -3074,6 +3074,24 @@ def Test_vim9_comment()
       'func Test() # comment',
       'endfunc',
       ], 'E488:')
+
+  var lines =<< trim END
+      vim9script
+      syn region Text
+      \ start='foo'
+      #\ comment
+      \ end='bar'
+  END
+  CheckScriptSuccess(lines)
+
+  lines =<< trim END
+      vim9script
+      syn region Text
+      \ start='foo'
+      "\ comment
+      \ end='bar'
+  END
+  CheckScriptFailure(lines, 'E399:')
 enddef
 
 def Test_vim9_comment_gui()
index aaf27c1423a1d45686e8e5c4c993cd180e23fc71..188bb1a8802bfbafeaa4dc7957fedcb509cb821f 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2925,
 /**/
     2924,
 /**/