Skip to content

Commit dee37dc

Browse files
committed
patch 8.2.2484: Vim9: Cannot use a comment starting with #{
Problem: Vim9: Cannot use a comment starting with #{ after an expression. Solution: Remove the check for "{" since #{ dictionaries are not supported.
1 parent 6628b7e commit dee37dc

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/ex_docmd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5212,8 +5212,7 @@ ends_excmd2(char_u *cmd_start UNUSED, char_u *cmd)
52125212
return TRUE;
52135213
#ifdef FEAT_EVAL
52145214
if (in_vim9script())
5215-
return c == '#' && cmd[1] != '{'
5216-
&& (cmd == cmd_start || VIM_ISWHITE(cmd[-1]));
5215+
return c == '#' && (cmd == cmd_start || VIM_ISWHITE(cmd[-1]));
52175216
#endif
52185217
return c == '"';
52195218
}

src/testdir/test_vim9_script.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2205,6 +2205,10 @@ def Test_while_loop()
22052205
result ..= cnt .. '_'
22062206
endwhile
22072207
assert_equal('1_3_', result)
2208+
2209+
var s = ''
2210+
while s == 'x' #{comment
2211+
endwhile
22082212
enddef
22092213

22102214
def Test_while_loop_fails()

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ static char *(features[]) =
750750

751751
static int included_patches[] =
752752
{ /* Add new patch number below this line */
753+
/**/
754+
2484,
753755
/**/
754756
2483,
755757
/**/

0 commit comments

Comments
 (0)