diff options
| author | bors <bors@rust-lang.org> | 2013-07-12 19:17:01 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-12 19:17:01 -0700 |
| commit | d2cf2925943b8de3578eaccd00661ceffdd22d7e (patch) | |
| tree | 17cecc64b55b7eb743ec0bbbff521633564e5eb7 /src/etc/vim/syntax/rust.vim | |
| parent | 1ee54a86171d70f439b3cf77e566150b78251bc2 (diff) | |
| parent | 4f67ed535b4a89491bdfa6854104a23d8a98f5c4 (diff) | |
| download | rust-d2cf2925943b8de3578eaccd00661ceffdd22d7e.tar.gz rust-d2cf2925943b8de3578eaccd00661ceffdd22d7e.zip | |
auto merge of #7742 : chris-morgan/rust/delimitmate-support, r=cmr
When it's a lifetime, a single quotation mark shouldn't have a matching single quotation mark inserted after it, as delimitMate does by default. Note that this is not without problems; a char literal coming after an odd number of lifetime markers will have its quotation marks behave a little strangely. That, however, is not my fault, but delimitMate's: https://github.com/Raimondi/delimitMate/issues/135
Diffstat (limited to 'src/etc/vim/syntax/rust.vim')
| -rw-r--r-- | src/etc/vim/syntax/rust.vim | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/etc/vim/syntax/rust.vim b/src/etc/vim/syntax/rust.vim index 3f654ea9030..12a504e4d0b 100644 --- a/src/etc/vim/syntax/rust.vim +++ b/src/etc/vim/syntax/rust.vim @@ -113,6 +113,11 @@ syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\(f\|f32\|f64\)\> syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\>" syn match rustFloat display "\<[0-9][0-9_]*\.[0-9_]\+\%([eE][+-]\=[0-9_]\+\)\(f\|f32\|f64\)\>" +" For the benefit of delimitMate +syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustLifetime +syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate +syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustLifetime + "rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" syn match rustCharacter "'\([^'\\]\|\\\(['nrt\\\"]\|x\x\{2}\|u\x\{4}\|U\x\{8}\)\)'" |
