Cf. #590: Add fold text and improve fold detect
This commit is contained in:
parent
4f829fe694
commit
d023d776a5
@ -49,7 +49,7 @@ function! vimtex#fold#init_script() " {{{1
|
|||||||
let s:folded .= ' ^\s*\%'
|
let s:folded .= ' ^\s*\%'
|
||||||
let s:folded .= '|^\s*\]\{'
|
let s:folded .= '|^\s*\]\{'
|
||||||
let s:folded .= '|^\s*}\s*$'
|
let s:folded .= '|^\s*}\s*$'
|
||||||
let s:folded .= '|\%\s*%(\{\{\{|}}})'
|
let s:folded .= '|\%%(.*\{\{\{|\s*}}})'
|
||||||
let s:folded .= '|\\%(' . join([
|
let s:folded .= '|\\%(' . join([
|
||||||
\ 'begin',
|
\ 'begin',
|
||||||
\ 'end',
|
\ 'end',
|
||||||
@ -213,7 +213,7 @@ function! vimtex#fold#level(lnum) " {{{1
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" Fold markers
|
" Fold markers
|
||||||
if line =~# '%\s*{{{'
|
if line =~# '%.*{{{'
|
||||||
return 'a1'
|
return 'a1'
|
||||||
elseif line =~# '%\s*}}}'
|
elseif line =~# '%\s*}}}'
|
||||||
return 's1'
|
return 's1'
|
||||||
@ -303,6 +303,12 @@ function! vimtex#fold#text() " {{{1
|
|||||||
\ . '}'
|
\ . '}'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if line =~# '%\s*{{{'
|
||||||
|
return ' ' . matchstr(line, '%\s*{{{\s*\zs.*')
|
||||||
|
elseif line =~# '%.*{{{'
|
||||||
|
return ' ' . matchstr(line, '%\s*\zs.*\ze{{{')
|
||||||
|
endif
|
||||||
|
|
||||||
" Text for newcommand (and similar)
|
" Text for newcommand (and similar)
|
||||||
if g:vimtex_fold_newcommands
|
if g:vimtex_fold_newcommands
|
||||||
\ && line =~# '\v^\s*\\%(re)?new%(command|environment)'
|
\ && line =~# '\v^\s*\\%(re)?new%(command|environment)'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user