Skip to content

Commit fc26911

Browse files
committed
vim: fix comment highlighting bug
Previous commit had a bug that a line which ends with "//" or "/*" is not correctly highlighted.
1 parent 7c2a8c4 commit fc26911

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/etc/vim/syntax/rust.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8
113113
syn region rustCommentDoc start="/\*\*" end="\*/"
114114
syn region rustCommentDoc start="///" skip="\\$" end="$" keepend
115115
syn match rustComment "/\*\*/"
116-
syn region rustComment start="/\*[^\*]" end="\*/" contains=rustTodo
117-
syn region rustComment start="//[^/]" skip="\\$" end="$" contains=rustTodo keepend
116+
syn region rustComment start="/\*\([^\*]\|$\)" end="\*/" contains=rustTodo
117+
syn region rustComment start="//\([^/]\|$\)" skip="\\$" end="$" contains=rustTodo keepend
118118

119119
syn keyword rustTodo contained TODO FIXME XXX NB
120120

0 commit comments

Comments
 (0)