Skip to content

Commit bf0a925

Browse files
committed
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.
2 parents 6b5ec40 + 05e45b9 commit bf0a925

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,3 @@ hi link rustNiceOperator Operator
2929
if !exists('g:rust_conceal_mod_path')
3030
hi! link Conceal Operator
3131
endif
32-
33-
setlocal conceallevel=2

src/etc/vim/ftplugin/rust.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ if exists("g:loaded_delimitMate")
5656
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
5757
endif
5858

59+
if has('conceal') && exists('g:rust_conceal')
60+
let b:rust_set_conceallevel=1
61+
setlocal conceallevel=2
62+
endif
63+
5964
" Motion Commands {{{1
6065

6166
" Bind motion commands to support hanging indents
@@ -103,6 +108,10 @@ let b:undo_ftplugin = "
103108
\|else
104109
\|unlet! b:delimitMate_excluded_regions
105110
\|endif
111+
\|if exists('b:rust_set_conceallevel')
112+
\|setlocal conceallevel<
113+
\|unlet b:rust_set_conceallevel
114+
\|endif
106115
\|unlet! b:rust_last_rustc_args b:rust_last_args
107116
\|delcommand RustRun
108117
\|delcommand RustExpand

0 commit comments

Comments
 (0)