diff --git a/autoload/vimtex/fold.vim b/autoload/vimtex/fold.vim index a348fd9..84f3764 100644 --- a/autoload/vimtex/fold.vim +++ b/autoload/vimtex/fold.vim @@ -180,7 +180,7 @@ function! s:refresh_folded_sections() " Initialize let b:vimtex_fold.parts = [] - let buffer = readfile(expand('%')) + let buffer = getline(1,'$') " Parse part commands (frontmatter, appendix, part, etc) let lines = filter(copy(buffer), 'v:val =~ ''' . s:parts . '''')