34 lines
847 B
Plaintext
34 lines
847 B
Plaintext
Execute (Setup):
|
|
let g:vimtex_fold_enabled = 1
|
|
|
|
Given tex (fold: commands):
|
|
\documentclass{article}
|
|
|
|
\newenvironment{ccd}{%
|
|
\begin{centered}\begin{tikzcd}}
|
|
{\end{tikzcd}\end{centered}%
|
|
}
|
|
|
|
\newenvironment{ccd}
|
|
{\begin{centered}\begin{tikzcd}}
|
|
{\end{tikzcd}\end{centered}}
|
|
|
|
% this should not be folded.
|
|
\begin{document}
|
|
|
|
\end{document}
|
|
|
|
Execute (fold: verify):
|
|
VimtexReload
|
|
AssertEqual foldlevel(1), 1, 'preamble start'
|
|
AssertEqual foldlevel(3), 2, 'newenvironment start'
|
|
AssertEqual foldlevel(6), 2, 'newenvironment end pre'
|
|
AssertEqual foldlevel(7), 1, 'newenvironment end post'
|
|
AssertEqual foldlevel(8), 1, 'newenvironment - not folded'
|
|
AssertEqual foldlevel(12), 1, 'preamble end pre'
|
|
AssertEqual foldlevel(13), 0, 'preamble end post'
|
|
|
|
Given:
|
|
Execute (Cleanup):
|
|
unlet g:vimtex_fold_enabled
|