diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-05-01 23:13:10 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-05-02 11:59:05 +0300 |
commit | cb1ef4788be0117f57497299ba008652f62cba24 (patch) | |
tree | cbfd1ad93c12a7d4c1ba1041a50e1d62e6447837 /doc/grosciteco.tes | |
parent | d734f9904bbe0ba33dd86083e44d89cf2da3cbb2 (diff) | |
download | sciteco-cb1ef4788be0117f57497299ba008652f62cba24.tar.gz |
grosciteco: folding in woman pages
* Support fold level configuration using `.SCITECO_FOLDLEVEL`.
This sets the current output line as the fold header and all subsequent lines
with the given fold level (until another `.SCITECO_FOLDLEVEL` instruction
is encountered).
* This is now done automatically for man's SH and SS macros,
so the man-page based woman pages provide folding.
* The folding margin is therefore now always enabled in fallback.teco_ini.
Diffstat (limited to 'doc/grosciteco.tes')
-rwxr-xr-x | doc/grosciteco.tes | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/grosciteco.tes b/doc/grosciteco.tes index 9be0f1a..5548f1c 100755 --- a/doc/grosciteco.tes +++ b/doc/grosciteco.tes @@ -169,6 +169,12 @@ EBN[input] Q[stylestart]ESSTARTSTYLING Q.s,(-Q[stylestart])ESSETSTYLING ]* L F< + !cmd.xXsciteco_foldlevel! + C :M#giU.[foldlevel] + [* EB 0:M[move] + Q.[foldlevel],(ESLINEFROMPOSITION)ESSETLINESTATE + ]* + L F< !cmd.xXtty! !cmd.xXdevtag! L F< @@ -342,6 +348,30 @@ J 0U#cs 0U#cd :C;> !* + * The fold level is stored in the line state since it is set + * while the document is not fully built yet. + *! +J 0U#li 0U[cur.fl] 0U[last.line] +ESGETLINECOUNT< + Q#liESGETLINESTATEU#fl + Q#fl"N + Q[cur.fl]"N + Q#li-Q[last.line]Ux + 1024%[cur.fl] + @:EU[styles]{\[last.line]U.l \x<\[cur.fl],Q.lESSETFOLDLEVEL %.l>^J} + ' + Q#li+1U[last.line] Q#flU[cur.fl] + (1024+Q#fl-1)#(2^*13)U#fl + @:EU[styles]{\#fl,\#liESSETFOLDLEVEL^J} + ' +%#li> +Q[cur.fl]"N + Q#li-Q[last.line]Ux + 1024%[cur.fl] + @:EU[styles]{\[last.line]U.l \x<\[cur.fl],Q.lESSETFOLDLEVEL %.l>^J} +' + +!* * Save the clear-text part of the document into <output-woman> *! 2EL EWQ[output-woman] |