Skip to content

Commit 2255587

Browse files
committed
auto merge of #5760 : klutzy/rust/vim, r=thestinger
1. disable nested comment which is not supported now 2. add syntax highlight for rustCommentDoc e.g. `/** doc */` or `/// doc`.
2 parents 5641777 + fc26911 commit 2255587

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/etc/vim/syntax/rust.vim

+6-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,11 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9
110110
syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
111111
syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"
112112

113-
syn region rustComment start="/\*" end="\*/" contains=rustComment,rustTodo
114-
syn region rustComment start="//" skip="\\$" end="$" contains=rustTodo keepend
113+
syn region rustCommentDoc start="/\*\*" end="\*/"
114+
syn region rustCommentDoc start="///" skip="\\$" end="$" keepend
115+
syn match rustComment "/\*\*/"
116+
syn region rustComment start="/\*\([^\*]\|$\)" end="\*/" contains=rustTodo
117+
syn region rustComment start="//\([^/]\|$\)" skip="\\$" end="$" contains=rustTodo keepend
115118

116119
syn keyword rustTodo contained TODO FIXME XXX NB
117120

@@ -134,6 +137,7 @@ hi def link rustConditional Conditional
134137
hi def link rustIdentifier Identifier
135138
hi def link rustModPath Include
136139
hi def link rustFuncName Function
140+
hi def link rustCommentDoc SpecialComment
137141
hi def link rustComment Comment
138142
hi def link rustMacro Macro
139143
hi def link rustType Type

0 commit comments

Comments
 (0)