]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #16486 : kballard/rust/vim_conceal, r=chris
authorbors <bors@rust-lang.org>
Fri, 15 Aug 2014 02:36:14 +0000 (02:36 +0000)
committerbors <bors@rust-lang.org>
Fri, 15 Aug 2014 02:36:14 +0000 (02:36 +0000)
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.

src/etc/vim/after/syntax/rust.vim
src/etc/vim/ftplugin/rust.vim

index 1ab8394e565a07e975180bfc73ca0fdb77f59a33..735c1e153a60dc070662d424cfcf1eef2714f6d4 100644 (file)
@@ -29,5 +29,3 @@ hi link rustNiceOperator Operator
 if !exists('g:rust_conceal_mod_path')
     hi! link Conceal Operator
 endif
-
-setlocal conceallevel=2
index 39edc1f9a20d754f880999235f63f1d1c35d1a92..8a538177403d35ff58b7ddc823e3c713d361d163 100644 (file)
@@ -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