about summary refs log tree commit diff
path: root/src/etc/vim/ftplugin/rust.vim
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-07-12 19:17:01 -0700
committerbors <bors@rust-lang.org>2013-07-12 19:17:01 -0700
commitd2cf2925943b8de3578eaccd00661ceffdd22d7e (patch)
tree17cecc64b55b7eb743ec0bbbff521633564e5eb7 /src/etc/vim/ftplugin/rust.vim
parent1ee54a86171d70f439b3cf77e566150b78251bc2 (diff)
parent4f67ed535b4a89491bdfa6854104a23d8a98f5c4 (diff)
downloadrust-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/ftplugin/rust.vim')
-rw-r--r--src/etc/vim/ftplugin/rust.vim9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/etc/vim/ftplugin/rust.vim b/src/etc/vim/ftplugin/rust.vim
index 063b1152cb2..bf02d7b1723 100644
--- a/src/etc/vim/ftplugin/rust.vim
+++ b/src/etc/vim/ftplugin/rust.vim
@@ -33,4 +33,11 @@ if exists("g:ftplugin_rust_source_path")
     let &l:path=g:ftplugin_rust_source_path . ',' . &l:path
 endif
 
-let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd<"
+if exists("g:loaded_delimitMate")
+	if exists("b:delimitMate_excluded_regions")
+		let b:rust_original_delimitMate_excluded_regions = b:delimitMate_excluded_regions
+	endif
+	let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
+endif
+
+let b:undo_ftplugin = "setlocal formatoptions< comments< commentstring< includeexpr< suffixesadd< | if exists('b:rust_original_delimitMate_excluded_regions') | let b:delimitMate_excluded_regions = b:rust_original_delimitMate_excluded_regions | unlet b:rust_original_delimitMate_excluded_regions | elseif exists('b:delimitMate_excluded_regions') | unlet b:delimitMate_excluded_regions | endif"