summaryrefslogtreecommitdiffstats
path: root/ftplugin/latex-box/folding.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ftplugin/latex-box/folding.vim')
-rw-r--r--ftplugin/latex-box/folding.vim8
1 files changed, 5 insertions, 3 deletions
diff --git a/ftplugin/latex-box/folding.vim b/ftplugin/latex-box/folding.vim
index 36f1577b..55a975f8 100644
--- a/ftplugin/latex-box/folding.vim
+++ b/ftplugin/latex-box/folding.vim
@@ -153,13 +153,15 @@ function! LatexBox_FoldLevel(lnum)
endif
endfor
+ " Never fold \end{document}
+ if line =~# '^\s*\\end{document}'
+ return 0
+ endif
+
" Fold environments
if g:LatexBox_fold_envs == 1
if line =~# s:envbeginpattern
return "a1"
- elseif line =~# '^\s*\\end{document}'
- " Never fold \end{document}
- return 0
elseif line =~# s:envendpattern
return "s1"
endif