diff options
| author | bors <bors@rust-lang.org> | 2014-03-01 17:36:41 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-03-01 17:36:41 -0800 |
| commit | b349fee46e393db4cfd8bcf6f89d770a26c9e077 (patch) | |
| tree | 8f8f23cf887bf44716996a2f24661d7959b7e033 /src/etc | |
| parent | 999d55d5f6e229b8c1118ac35c8cbf3b9c59e3a1 (diff) | |
| parent | bc35eb78e2dab6b7cb3ede9176b0cfcafc4f8362 (diff) | |
| download | rust-b349fee46e393db4cfd8bcf6f89d770a26c9e077.tar.gz rust-b349fee46e393db4cfd8bcf6f89d770a26c9e077.zip | |
Merge pull request #12308 from kballard/vim-nested-comments
vim: Tweak how comment nesting works Reviewed-by: brson
Diffstat (limited to 'src/etc')
| -rw-r--r-- | src/etc/vim/syntax/rust.vim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index cc158bb44af..bd27f057339 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -163,11 +163,12 @@ syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[ syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" syn match rustCharacter /'\([^'\\]\|\\\(.\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial,rustSpecialError -syn cluster rustComment contains=rustCommentLine,rustCommentLineDoc,rustCommentBlock,rustCommentBlockDoc -syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell -syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell -syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,@rustComment,@Spell keepend extend -syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,@rustComment,@Spell keepend extend +syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell +syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell +syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell +syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell +syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent +syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent " FIXME: this is a really ugly and not fully correct implementation. Most " importantly, a case like ``/* */*`` should have the final ``*`` not being in " a comment, but in practice at present it leaves comments open two levels |
