Fix fdm save and restore for insertmode
This commit is contained in:
parent
55c8068320
commit
7152088e22
@ -19,8 +19,8 @@ function! latex#fold#init(initialized)
|
|||||||
if !a:initialized
|
if !a:initialized
|
||||||
augroup latex_fold
|
augroup latex_fold
|
||||||
autocmd!
|
autocmd!
|
||||||
autocmd InsertEnter *.tex setlocal foldmethod=manual
|
autocmd InsertEnter *.tex call s:fdm_save()
|
||||||
autocmd InsertLeave *.tex setlocal foldmethod=expr
|
autocmd InsertLeave *.tex call s:fdm_restore()
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -163,6 +163,18 @@ function! latex#fold#text()
|
|||||||
endfunction
|
endfunction
|
||||||
" }}}1
|
" }}}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
|
" {{{1 s:find_fold_sections
|
||||||
function! s:find_fold_sections()
|
function! s:find_fold_sections()
|
||||||
"
|
"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user