vimtex/autoload/toc.vim

32 lines
525 B
VimL
Raw Normal View History

function! toc#fold_level(lnum) " {{{1
let pline = getline(a:lnum - 1)
let cline = getline(a:lnum)
let nline = getline(a:lnum + 1)
let pn = matchstr(pline, '\d$')
let cn = matchstr(cline, '\d$')
let nn = matchstr(nline, '\d$')
" Don't fold options
if cline =~# '^\s*$'
return 0
endif
if nn > cn
return '>' . nn
endif
if cn < pn && cn >= nn
return cn
endif
return '='
2013-10-05 07:53:42 -04:00
endfunction
function! toc#fold_text() " {{{1
return getline(v:foldstart)
2013-10-05 07:53:42 -04:00
endfunction
" }}}1
2014-02-10 08:21:43 -05:00
" vim: fdm=marker