Skip to content

Commit

Permalink
vim: Stop setting conceallevel in the syntax file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lilyball committed Aug 13, 2014
1 parent 0f09f51 commit 05e45b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/etc/vim/after/syntax/rust.vim
Expand Up @@ -29,5 +29,3 @@ hi link rustNiceOperator Operator
if !exists('g:rust_conceal_mod_path')
hi! link Conceal Operator
endif

setlocal conceallevel=2
9 changes: 9 additions & 0 deletions src/etc/vim/ftplugin/rust.vim
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

5 comments on commit 05e45b9

@bors
Copy link
Contributor

@bors bors commented on 05e45b9 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from chris
at lilyball@05e45b9

@bors
Copy link
Contributor

@bors bors commented on 05e45b9 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging kballard/rust/vim_conceal = 05e45b9 into auto

@bors
Copy link
Contributor

@bors bors commented on 05e45b9 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kballard/rust/vim_conceal = 05e45b9 merged ok, testing candidate = bf0a925

@bors
Copy link
Contributor

@bors bors commented on 05e45b9 Aug 15, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = bf0a925

Please sign in to comment.