about summary refs log tree commit diff
path: root/src/etc/vim/syntax
diff options
context:
space:
mode:
authorChris Morgan <me@chrismorgan.info>2013-08-29 15:22:34 +1000
committerChris Morgan <me@chrismorgan.info>2013-09-04 02:34:22 +1000
commit15f05dc581f4978c91113a0bce6ea2fdfc164ca0 (patch)
treeb17b23fa9b402ce06e40df99723defcee9262cd3 /src/etc/vim/syntax
parentc14daba3b2f3218438a6928ed0676986c6339d48 (diff)
downloadrust-15f05dc581f4978c91113a0bce6ea2fdfc164ca0.tar.gz
rust-15f05dc581f4978c91113a0bce6ea2fdfc164ca0.zip
Modernise some Vim syntax highlighting.
- Remove highlighting of ``L"..."`` (obsolete syntax)
- Remove backslash at end of line being a line continuation always
  (obsolete syntax; this only affects comments, actually)
- Add highlighting for backslash at end of line and leading whitespace
  on the following line inside a string (a genuine line continuation)
Diffstat (limited to 'src/etc/vim/syntax')
-rw-r--r--src/etc/vim/syntax/rust.vim8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim
index b5e52939635..6bf6946c797 100644
--- a/src/etc/vim/syntax/rust.vim
+++ b/src/etc/vim/syntax/rust.vim
@@ -102,7 +102,8 @@ syn match     rustMacro       '#\w\(\w\)*' contains=rustAssert,rustFail
 syn match     rustFormat      display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn?]\|\[\^\=.[^]]*\]\)" contained
 syn match     rustFormat      display "%%" contained
 syn match     rustSpecial     display contained /\\\([nrt\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/
-syn region    rustString      start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat,rustSpecial
+syn match     rustStringContinuation display contained /\\\n\s*/
+syn region    rustString      start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo,rustFormat,rustSpecial,rustStringContinuation
 
 syn region    rustAttribute   start="#\[" end="\]" contains=rustString,rustDeriving
 syn region    rustDeriving    start="deriving(" end=")" contained contains=rustTrait
@@ -137,9 +138,9 @@ syn match     rustLifetime    display "\'\%([^[:cntrl:][:space:][:punct:][:digit
 syn match   rustCharacter   /'\([^'\\]\|\\\([nrt\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'/ contains=rustSpecial
 
 syn region    rustCommentML   start="/\*" end="\*/" contains=rustTodo
-syn region    rustComment     start="//" skip="\\$" end="$" contains=rustTodo keepend
+syn region    rustComment     start="//" end="$" contains=rustTodo keepend
 syn region    rustCommentMLDoc start="/\*\%(!\|\*/\@!\)" end="\*/" contains=rustTodo
-syn region    rustCommentDoc  start="//[/!]" skip="\\$" end="$" contains=rustTodo keepend
+syn region    rustCommentDoc  start="//[/!]" end="$" contains=rustTodo keepend
 
 syn keyword rustTodo contained TODO FIXME XXX NB NOTE
 
@@ -157,6 +158,7 @@ hi def link rustTrait           rustType
 hi def link rustSigil         StorageClass
 hi def link rustFormat        Special
 hi def link rustSpecial       Special
+hi def link rustStringContinuation Special
 hi def link rustString        String
 hi def link rustCharacter     Character
 hi def link rustNumber        Number