Skip to content

Commit 93f82cb

Browse files
committed
patch 8.2.2135: Vim9: #{ still seen as start of dict in some places
Problem: Vim9: #{ still seen as start of dict in some places. Solution: Remove check for { after #. (closes #7456)
1 parent 57f799e commit 93f82cb

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

src/ex_docmd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ comment_start(char_u *p, int starts_with_colon UNUSED)
16831683
{
16841684
#ifdef FEAT_EVAL
16851685
if (in_vim9script())
1686-
return p[0] == '#' && p[1] != '{' && !starts_with_colon;
1686+
return p[0] == '#' && !starts_with_colon;
16871687
#endif
16881688
return *p == '"';
16891689
}
@@ -4780,7 +4780,6 @@ separate_nextcmd(exarg_T *eap)
47804780
|| (*p == '#'
47814781
&& in_vim9script()
47824782
&& !(eap->argt & EX_NOTRLCOM)
4783-
&& p[1] != '{'
47844783
&& p > eap->cmd && VIM_ISWHITE(p[-1]))
47854784
#endif
47864785
|| *p == '|' || *p == '\n')

src/testdir/test_vim9_script.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,7 +2069,21 @@ def Test_vim9_comment()
20692069
CheckScriptSuccess([
20702070
'vim9script',
20712071
'# something',
2072+
'#something',
2073+
'#{something',
20722074
])
2075+
2076+
split Xfile
2077+
CheckScriptSuccess([
2078+
'vim9script',
2079+
'edit #something',
2080+
])
2081+
CheckScriptSuccess([
2082+
'vim9script',
2083+
'edit #{something',
2084+
])
2085+
close
2086+
20732087
CheckScriptFailure([
20742088
'vim9script',
20752089
':# something',

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+
2135,
753755
/**/
754756
2134,
755757
/**/

0 commit comments

Comments
 (0)