diff --git a/autoload/latex/fold.vim b/autoload/latex/fold.vim index c0e5a7c..c2638f6 100644 --- a/autoload/latex/fold.vim +++ b/autoload/latex/fold.vim @@ -10,6 +10,11 @@ function! latex#fold#init(initialized) nnoremap zx :call latex#fold#refresh()zx endif + " + " For some reason, foldmethod=expr makes undo slow (at least in some cases) + " + nnoremap u :call FdmSave()u:call FdmRestore() + " " The foldexpr function returns "=" for most lines, which means it can " become slow for large files. The following is a hack that is based on @@ -19,8 +24,8 @@ function! latex#fold#init(initialized) if !a:initialized augroup latex_fold autocmd! - autocmd InsertEnter *.tex call s:fdm_save() - autocmd InsertLeave *.tex call s:fdm_restore() + autocmd InsertEnter *.tex call FdmSave() + autocmd InsertLeave *.tex call FdmRestore() augroup END endif endif @@ -163,21 +168,22 @@ function! latex#fold#text() endfunction " }}}1 -" {{{1 s:notbslash and s:notcomment -let s:notbslash = '\%(\\\@