Skip to content

Commit

Permalink
patch 8.2.2925: Vim9: line continuation comment uses legacy syntax
Browse files Browse the repository at this point in the history
Problem:    Vim9: line continuation comment uses legacy syntax.
Solution:   Check for #\ instead of "\. (closes #8295)
  • Loading branch information
brammool committed Jun 2, 2021
1 parent a2e468f commit 0f37e35
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scriptfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,8 @@ getsourceline(
ga_concat(&ga, p);
}
}
else if (!(p[0] == '"' && p[1] == '\\' && p[2] == ' ')
else if (!(p[0] == (in_vim9script() ? '#' : '"')
&& p[1] == '\\' && p[2] == ' ')
&& !(do_vim9_all && (*p == NUL || vim9_comment_start(p))))
break;
/* drop a # comment or "\ comment line */
Expand Down
18 changes: 18 additions & 0 deletions src/testdir/test_vim9_script.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3074,6 +3074,24 @@ def Test_vim9_comment()
'func Test() # comment',
'endfunc',
], 'E488:')

var lines =<< trim END
vim9script
syn region Text
\ start='foo'
#\ comment
\ end='bar'
END
CheckScriptSuccess(lines)

lines =<< trim END
vim9script
syn region Text
\ start='foo'
"\ comment
\ end='bar'
END
CheckScriptFailure(lines, 'E399:')
enddef

def Test_vim9_comment_gui()
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 */
/**/
2925,
/**/
2924,
/**/
Expand Down

0 comments on commit 0f37e35

Please sign in to comment.