diff --git a/autoload/toc.vim b/autoload/toc.vim index 9d27ee3..b0415a1 100644 --- a/autoload/toc.vim +++ b/autoload/toc.vim @@ -1,5 +1,5 @@ -" {{{1 latextoc#fold_level -function! latextoc#fold_level(lnum) +" {{{1 toc#fold_level +function! toc#fold_level(lnum) let line = getline(a:lnum) let match_s1 = line =~# '^\w\+\s' let match_s2 = line =~# '^\w\+\.\w\+\s' @@ -30,8 +30,8 @@ function! latextoc#fold_level(lnum) return "=" endfunction -" {{{1 latextoc#fold_text -function! latextoc#fold_text() +" {{{1 toc#fold_text +function! toc#fold_text() let parts = matchlist(getline(v:foldstart), '^\(.*\)\t\(.*\)$') return printf('%-8s%-72s', parts[1], parts[2]) endfunction diff --git a/ftplugin/latextoc.vim b/ftplugin/latextoc.vim index 308db94..e499545 100644 --- a/ftplugin/latextoc.vim +++ b/ftplugin/latextoc.vim @@ -24,8 +24,8 @@ setlocal cole=0 setlocal cocu=nvic if g:latex_toc_fold setlocal foldmethod=expr - setlocal foldexpr=toc#fold(v:lnum) - setlocal foldtext=toc#fold_tex() + setlocal foldexpr=toc#fold_level(v:lnum) + setlocal foldtext=toc#fold_text() endif " Define mappings