Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vim: Don't set foldmethod in the syntax file either #16527

Merged
merged 1 commit into from
Aug 16, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/etc/vim/ftplugin/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ if exists("g:loaded_delimitMate")
let b:delimitMate_excluded_regions = delimitMate#Get("excluded_regions") . ',rustLifetimeCandidate,rustGenericLifetimeCandidate'
endif

if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
let b:rust_set_foldmethod=1
setlocal foldmethod=syntax
if g:rust_fold == 2
setlocal foldlevel<
else
setlocal foldlevel=99
endif
endif

if has('conceal') && exists('g:rust_conceal')
let b:rust_set_conceallevel=1
setlocal conceallevel=2
Expand Down Expand Up @@ -108,6 +118,10 @@ let b:undo_ftplugin = "
\|else
\|unlet! b:delimitMate_excluded_regions
\|endif
\|if exists('b:rust_set_foldmethod')
\|setlocal foldmethod< foldlevel<
\|unlet b:rust_set_foldmethod
\|endif
\|if exists('b:rust_set_conceallevel')
\|setlocal conceallevel<
\|unlet b:rust_set_conceallevel
Expand Down
11 changes: 0 additions & 11 deletions src/etc/vim/syntax/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,6 @@ elseif exists("b:current_syntax")
finish
endif

" Fold settings {{{1

if has("folding") && exists('g:rust_fold') && g:rust_fold != 0
setlocal foldmethod=syntax
if g:rust_fold == 2
setlocal foldlevel<
else
setlocal foldlevel=99
endif
endif

" Syntax definitions {{{1
" Basic keywords {{{2
syn keyword rustConditional match if else
Expand Down