]> granicus.if.org Git - vim/commitdiff
patch 8.2.2484: Vim9: Cannot use a comment starting with #{ v8.2.2484
authorBram Moolenaar <Bram@vim.org>
Sun, 7 Feb 2021 15:40:05 +0000 (16:40 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 7 Feb 2021 15:40:05 +0000 (16:40 +0100)
Problem:    Vim9: Cannot use a comment starting with #{ after an expression.
Solution:   Remove the check for "{" since #{ dictionaries are not supported.

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

index a2e53ad349440da7f577213e88039eecb0a63faf..9409d7c5e0502e0d54ece03f5f36c2a051ced35f 100644 (file)
@@ -5212,8 +5212,7 @@ ends_excmd2(char_u *cmd_start UNUSED, char_u *cmd)
        return TRUE;
 #ifdef FEAT_EVAL
     if (in_vim9script())
-       return c == '#' && cmd[1] != '{'
-                                && (cmd == cmd_start || VIM_ISWHITE(cmd[-1]));
+       return c == '#' && (cmd == cmd_start || VIM_ISWHITE(cmd[-1]));
 #endif
     return c == '"';
 }
index 72e12740adc940b1d97741e31812db70bb4ee0e0..7f1e71dc68b0bd132b5809933f492b5a39b0275d 100644 (file)
@@ -2205,6 +2205,10 @@ def Test_while_loop()
     result ..= cnt .. '_'
   endwhile
   assert_equal('1_3_', result)
+
+  var s = ''
+  while s == 'x' #{comment
+  endwhile
 enddef
 
 def Test_while_loop_fails()
index 4c53107001730d43e7af646e3390d4c47ffeb0b4..cbef3daf67ea8f94c72343ccc2d5a0bbd9a4c366 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2484,
 /**/
     2483,
 /**/