From 617b01a5b6aa3cadb25b2ff8639e330cfc6cf3c1 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 11 Nov 2014 02:37:21 +0100 Subject: Update --- ftplugin/latex-box/folding.vim | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'ftplugin/latex-box/folding.vim') diff --git a/ftplugin/latex-box/folding.vim b/ftplugin/latex-box/folding.vim index 4fe13bc8..5d733c23 100644 --- a/ftplugin/latex-box/folding.vim +++ b/ftplugin/latex-box/folding.vim @@ -156,7 +156,7 @@ let s:notcomment = '\%(\%(\\\@= 0 + if line =~# s:envbeginpattern && line =~# s:envendpattern + " If the begin and end pattern are on the same line , do not fold + return "=" + else + if line =~# s:envbeginpattern + if g:LatexBox_fold_envs == 1 return "a1" else - return "=" + let env = matchstr(line,'\\begin\*\?{\zs\w*\*\?\ze}') + if index(g:LatexBox_fold_envs_force, env) >= 0 + return "a1" + else + return "=" + endif 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 + elseif line =~# s:envendpattern + if g:LatexBox_fold_envs == 1 return "s1" else - return "=" + let env = matchstr(line,'\\end\*\?{\zs\w*\*\?\ze}') + if index(g:LatexBox_fold_envs_force, env) >= 0 + return "s1" + else + return "=" + endif endif endif endif @@ -288,7 +293,7 @@ function! LatexBox_FoldText_title() endif " Parts, sections and fakesections - let sections = '\(\(sub\)*section\|part\|chapter\)' + let sections = '\(\(sub\)*\(section\|paragraph\)\|part\|chapter\)' let secpat1 = '^\s*\\' . sections . '\*\?\s*{' let secpat2 = '^\s*\\' . sections . '\*\?\s*\[' if line =~ '\\frontmatter' -- cgit v1.2.3