about summary refs log tree commit diff
path: root/src/etc/vim/syntax
diff options
context:
space:
mode:
authorChris Morgan <me@chrismorgan.info>2013-07-10 09:56:08 +1000
committerDaniel Micay <danielmicay@gmail.com>2013-07-11 14:38:24 -0400
commit1d08ceb0439e1d09cb2285578872df53ad7eeb8c (patch)
tree93395aa333cc1c68cccb04113182e885473c2c92 /src/etc/vim/syntax
parent00da76dfbe3aba8c1ec399ecfa0eae4b4ba6885e (diff)
downloadrust-1d08ceb0439e1d09cb2285578872df53ad7eeb8c.tar.gz
rust-1d08ceb0439e1d09cb2285578872df53ad7eeb8c.zip
Fix comment indenting properly for Vim files.
Indentation now works correctly on subsequent lines of a multi-line
comment, whether there are leaders (` * `) or not. (Formerly it was
incorrectly doing a two-space indent if there was no leader.)

By default, this no longer puts a ` * ` leader on `/*!` comments, as
that appears to be the current convention in the Rust source code, but
that can easily be re-enabled if desired:

    let g:rust_bang_comment_leader = 1
Diffstat (limited to 'src/etc/vim/syntax')
-rw-r--r--src/etc/vim/syntax/rust.vim6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim
index dfcdb11e768..3f654ea9030 100644
--- a/src/etc/vim/syntax/rust.vim
+++ b/src/etc/vim/syntax/rust.vim
@@ -117,9 +117,9 @@ syn match     rustFloat       display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9
 syn match     rustLifetime    display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*"
 syn match   rustCharacter   "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'"
 
-syn region    rustComment     start="/\*" end="\*/" contains=rustTodo
+syn region    rustCommentML   start="/\*" end="\*/" contains=rustTodo
 syn region    rustComment     start="//" skip="\\$" end="$" contains=rustTodo keepend
-syn region    rustCommentDoc  start="/\*\%(!\|\*/\@!\)" end="\*/" contains=rustTodo
+syn region    rustCommentMLDoc start="/\*\%(!\|\*/\@!\)" end="\*/" contains=rustTodo
 syn region    rustCommentDoc  start="//[/!]" skip="\\$" end="$" contains=rustTodo keepend
 
 syn keyword rustTodo contained TODO FIXME XXX NB NOTE
@@ -151,7 +151,9 @@ hi def link rustModPath       Include
 hi def link rustModPathSep    Delimiter
 hi def link rustFuncName      Function
 hi def link rustFuncCall      Function
+hi def link rustCommentMLDoc  rustCommentDoc
 hi def link rustCommentDoc    SpecialComment
+hi def link rustCommentML     rustComment
 hi def link rustComment       Comment
 hi def link rustAssert        PreCondit
 hi def link rustFail          PreCondit