]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.2135: Vim9: #{ still seen as start of dict in some places v8.2.2135
authorBram Moolenaar <Bram@vim.org>
Sat, 12 Dec 2020 20:25:56 +0000 (21:25 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 12 Dec 2020 20:25:56 +0000 (21:25 +0100)
Problem:    Vim9: #{ still seen as start of dict in some places.
Solution:   Remove check for { after #. (closes #7456)

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

index 065a03823224558df896868db107220b664bde60..c80d23e10f8010ebb210e054dab11cf3b95f4b9e 100644 (file)
@@ -1683,7 +1683,7 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
 {
 #ifdef FEAT_EVAL
     if (in_vim9script())
-       return p[0] == '#' && p[1] != '{' && !starts_with_colon;
+       return p[0] == '#' && !starts_with_colon;
 #endif
     return *p == '"';
 }
@@ -4780,7 +4780,6 @@ separate_nextcmd(exarg_T *eap)
                || (*p == '#'
                    && in_vim9script()
                    && !(eap->argt & EX_NOTRLCOM)
-                   && p[1] != '{'
                    && p > eap->cmd && VIM_ISWHITE(p[-1]))
 #endif
                || *p == '|' || *p == '\n')
index bb070cacdc03e22871ab811229faf093dd97c8ae..45103fcac028e42ca50c106d4373a0343672dbe2 100644 (file)
@@ -2069,7 +2069,21 @@ def Test_vim9_comment()
   CheckScriptSuccess([
       'vim9script',
       '# something',
+      '#something',
+      '#{something',
       ])
+
+  split Xfile
+  CheckScriptSuccess([
+      'vim9script',
+      'edit #something',
+      ])
+  CheckScriptSuccess([
+      'vim9script',
+      'edit #{something',
+      ])
+  close
+
   CheckScriptFailure([
       'vim9script',
       ':# something',
index f4211effafb0d08641048f67a29238384b39e2e6..7f78742acdf6286c1081a971e805734526ebd83b 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2135,
 /**/
     2134,
 /**/