Skip to content

Commit

Permalink
patch 8.2.2135: Vim9: #{ still seen as start of dict in some places
Browse files Browse the repository at this point in the history
Problem:    Vim9: #{ still seen as start of dict in some places.
Solution:   Remove check for { after #. (closes #7456)
  • Loading branch information
brammool committed Dec 12, 2020
1 parent 57f799e commit 93f82cb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/ex_docmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 == '"';
}
Expand Down Expand Up @@ -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')
Expand Down
14 changes: 14 additions & 0 deletions src/testdir/test_vim9_script.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2135,
/**/
2134,
/**/
Expand Down

0 comments on commit 93f82cb

Please sign in to comment.