Fixed #430: Allow manual enabling of folding

This commit is contained in:
Karl Yngve Lervåg 2016-04-08 23:26:36 +02:00
parent a4eb3d4353
commit c673e928a0

View File

@ -40,12 +40,14 @@ endfunction
" }}}1 " }}}1
function! vimtex#fold#init_buffer() " {{{1 function! vimtex#fold#init_buffer() " {{{1
" b:vimtex_fold is a dictionary used to store dynamic fold information
" Note: We define this even if folding is disabled, because people might want
" to enable folding manually
let b:vimtex_fold = {}
if !g:vimtex_fold_enabled | return | endif if !g:vimtex_fold_enabled | return | endif
if s:foldmethod_in_modeline() | return | endif if s:foldmethod_in_modeline() | return | endif
" Initialize local work vars
let b:vimtex_fold = {}
" Set fold options " Set fold options
setlocal foldmethod=expr setlocal foldmethod=expr
setlocal foldexpr=vimtex#fold#level(v:lnum) setlocal foldexpr=vimtex#fold#level(v:lnum)