about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-08-15 02:36:14 +0000
committerbors <bors@rust-lang.org>2014-08-15 02:36:14 +0000
commitbf0a925dcde7a2c66df4e05661a9b1d1472435ab (patch)
treeabca030b6aa1312760c5d5e2c359c61d4bd15c46
parent6b5ec40d452d910148de7c87121acbbe1be8851a (diff)
parent05e45b9e365edad947ff4de10680127686e39a04 (diff)
downloadrust-bf0a925dcde7a2c66df4e05661a9b1d1472435ab.tar.gz
rust-bf0a925dcde7a2c66df4e05661a9b1d1472435ab.zip
auto merge of #16486 : kballard/rust/vim_conceal, r=chris
We shouldn't be setting conceallevel in the syntax file. Besides not
being able to undo this if we switch to another syntax later, it also
interferes with embedding rust in other filetypes (such as markdown).

Instead, set it in the ftplugin, where it belongs.
-rw-r--r--src/etc/vim/after/syntax/rust.vim2
-rw-r--r--src/etc/vim/ftplugin/rust.vim9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/etc/vim/after/syntax/rust.vim b/src/etc/vim/after/syntax/rust.vim
index 1ab8394e565..735c1e153a6 100644
--- a/src/etc/vim/after/syntax/rust.vim
+++ b/src/etc/vim/after/syntax/rust.vim
@@ -29,5 +29,3 @@ hi link rustNiceOperator Operator
 if !exists('g:rust_conceal_mod_path')
     hi! link Conceal Operator
 endif
-
-setlocal conceallevel=2
diff --git a/src/etc/vim/ftplugin/rust.vim b/src/etc/vim/ftplugin/rust.vim
index 39edc1f9a20..8a538177403 100644
--- a/src/etc/vim/ftplugin/rust.vim
+++ b/src/etc/vim/ftplugin/rust.vim
@@ -56,6 +56,11 @@ if exists("g:loaded_delimitMate")
 	let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
 endif
 
+if has('conceal') && exists('g:rust_conceal')
+	let b:rust_set_conceallevel=1
+	setlocal conceallevel=2
+endif
+
 " Motion Commands {{{1
 
 " Bind motion commands to support hanging indents
@@ -103,6 +108,10 @@ let b:undo_ftplugin = "
 		\|else
 		  \|unlet! b:delimitMate_excluded_regions
 		\|endif
+		\|if exists('b:rust_set_conceallevel')
+		  \|setlocal conceallevel<
+		  \|unlet b:rust_set_conceallevel
+		\|endif
 		\|unlet! b:rust_last_rustc_args b:rust_last_args
 		\|delcommand RustRun
 		\|delcommand RustExpand