Skip to content

Commit d8c18d9

Browse files
committed
Fix Comment Regions
Our comment detection was a bit buggy because we did not use the extend keyword. This meant that if the comment was contained within a region or a match of sorts, it would get pre-maturely ended by a containing group. Using the extend keyword means that it will override any containing parent matcher and still display a comment, which is how JS actually interprets the code.
1 parent d87bcd1 commit d8c18d9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

syntax/javascript.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ syntax region jsExportContainer start="^\s\?export \?" end="$" contains=jsM
4646

4747
"" JavaScript comments
4848
syntax keyword jsCommentTodo TODO FIXME XXX TBD contained
49-
syntax region jsLineComment start=+\/\/+ end=+$+ keepend contains=jsCommentTodo,@Spell
49+
syntax region jsLineComment start=+\/\/+ end=+$+ keepend contains=jsCommentTodo,@Spell extend
5050
syntax region jsEnvComment start="\%^#!" end="$" display
5151
syntax region jsLineComment start=+^\s*\/\/+ skip=+\n\s*\/\/+ end=+$+ keepend contains=jsCommentTodo,@Spell fold
5252
syntax region jsCvsTag start="\$\cid:" end="\$" oneline contained
53-
syntax region jsComment start="/\*" end="\*/" contains=jsCommentTodo,jsCvsTag,@Spell fold
53+
syntax region jsComment start="/\*" end="\*/" contains=jsCommentTodo,jsCvsTag,@Spell fold extend
5454

5555
"" JSDoc / JSDoc Toolkit
5656
if !exists("javascript_ignore_javaScriptdoc")

0 commit comments

Comments
 (0)