forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto merge of rust-lang#11311 : hdima/rust/vim-syntax-spell-check, r=cmr
Add `@Spell` clusters to Vim syntax highlighting file to do spell checking only inside comments and strings
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
" Maintainer: Patrick Walton <[email protected]> | ||
" Maintainer: Ben Blum <[email protected]> | ||
" Maintainer: Chris Morgan <[email protected]> | ||
" Last Change: 2013 Dec 10 | ||
" Last Change: 2014 Jan 4 | ||
|
||
if version < 600 | ||
syntax clear | ||
|
@@ -147,8 +147,8 @@ syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustFail | |
syn match rustSpecialError display contained /\\./ | ||
syn match rustSpecial display contained /\\\([nrt0\\'"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)/ | ||
syn match rustStringContinuation display contained /\\\n\s*/ | ||
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustSpecial,rustSpecialError,rustStringContinuation | ||
syn region rustString start='r\z(#*\)"' end='"\z1' | ||
syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustSpecial,rustSpecialError,rustStringContinuation,@Spell | ||
syn region rustString start='r\z(#*\)"' end='"\z1' contains=@Spell | ||
|
||
syn region rustAttribute start="#\[" end="\]" contains=rustString,rustDeriving | ||
syn region rustDeriving start="deriving(" end=")" contained contains=rustTrait | ||
|
@@ -179,10 +179,10 @@ syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit | |
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 | ||
syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo | ||
syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,@rustComment keepend extend | ||
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,@rustComment 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,@rustComment,@Spell keepend extend | ||
syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,@rustComment,@Spell keepend extend | ||
" 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 | ||
|