Change fakesection fold text and add doc

Ref. #292
This commit is contained in:
Karl Yngve Lervåg 2015-12-04 22:18:38 +01:00
parent fa9af58376
commit 5cc4fead62
2 changed files with 13 additions and 3 deletions

View File

@ -229,10 +229,8 @@ function! vimtex#fold#text() " {{{1
let title = matchstr(line, secpat2 . '\zs.*\ze\]')
elseif line =~ secpat2
let title = matchstr(line, secpat2 . '\zs.*')
elseif line =~ 'Fake' . sections . ':'
let title = matchstr(line,'Fake' . sections . ':\s*\zs.*')
elseif line =~ 'Fake' . sections
let title = matchstr(line, 'Fake' . sections)
let title = matchstr(line, 'Fake' . sections . '.*')
endif
" Environments

View File

@ -1360,6 +1360,18 @@ frontmatter, backmatter, and appendix) and section types (chapter, section,
etc.) are present. This parsing is done automatically every time the folds are
recomputed, if there are any changes to the file.
The fold function also recognizes "fake" sections. That is, it parses comments
similar to: >
% Fakepart title
% Fakechapter title
% Fakesection title
% Fakesubsection title
The fake sections are folded at the same level as the corresponding "real"
sections. The fold title is the provided title with the `Fake...` part
prepended.
Note: The |fold-expr| method of folding is well known to be slow, e.g. for
long lines and large files. To speed things up, the user may want to
enable the |g:vimtex_fold_manual| option. An alternative is to add