Fix fdm save and restore for insertmode

This commit is contained in:
Karl Yngve Lervåg 2013-10-07 15:49:22 +02:00
parent 55c8068320
commit 7152088e22

View File

@ -19,8 +19,8 @@ function! latex#fold#init(initialized)
if !a:initialized
augroup latex_fold
autocmd!
autocmd InsertEnter *.tex setlocal foldmethod=manual
autocmd InsertLeave *.tex setlocal foldmethod=expr
autocmd InsertEnter *.tex call s:fdm_save()
autocmd InsertLeave *.tex call s:fdm_restore()
augroup END
endif
endif
@ -163,6 +163,18 @@ function! latex#fold#text()
endfunction
" }}}1
" {{{1 s:fdm_restore
function! s:fdm_restore()
silent execute 'setlocal foldmethod=' . s:fdm
endfunction
" {{{1 s:fdm_save
let s:fdm=''
function! s:fdm_save()
let s:fdm = &foldmethod
setlocal foldmethod=manual
endfunction
" {{{1 s:find_fold_sections
function! s:find_fold_sections()
"