diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2014-03-11 00:36:09 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2014-03-11 00:36:09 +0100 |
commit | 94f72a68c3dccade13ec7203a284620040f930f1 (patch) | |
tree | a19a08381285c40c59f882b211039514ea2e69d4 /ftplugin/latex-box/folding.vim | |
parent | 9b3b092d15503ed70ea4bf60c4e1345b196c3677 (diff) | |
download | vim-polyglot-1.5.3.tar.gz vim-polyglot-1.5.3.zip |
Updatev1.5.3
Diffstat (limited to 'ftplugin/latex-box/folding.vim')
-rw-r--r-- | ftplugin/latex-box/folding.vim | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/ftplugin/latex-box/folding.vim b/ftplugin/latex-box/folding.vim index 55a975f8..badfc137 100644 --- a/ftplugin/latex-box/folding.vim +++ b/ftplugin/latex-box/folding.vim @@ -31,6 +31,9 @@ endif if !exists('g:LatexBox_fold_envs') let g:LatexBox_fold_envs=1 endif +if !exists('g:LatexBox_fold_envs_force') + let g:LatexBox_fold_envs_force = [] +endif if !exists('g:LatexBox_fold_parts') let g:LatexBox_fold_parts=[ \ "appendix", @@ -159,11 +162,27 @@ function! LatexBox_FoldLevel(lnum) endif " Fold environments - if g:LatexBox_fold_envs == 1 - if line =~# s:envbeginpattern + if line =~# s:envbeginpattern + if g:LatexBox_fold_envs == 1 return "a1" - elseif line =~# s:envendpattern + else + let env = matchstr(line,'\\begin\*\?{\zs\w*\*\?\ze}') + if index(g:LatexBox_fold_envs_force, env) >= 0 + return "a1" + else + return "=" + endif + endif + elseif line =~# s:envendpattern + if g:LatexBox_fold_envs == 1 return "s1" + else + let env = matchstr(line,'\\end\*\?{\zs\w*\*\?\ze}') + if index(g:LatexBox_fold_envs_force, env) >= 0 + return "s1" + else + return "=" + endif endif endif |