D18895: AsciiDoc: Add folding for sections

PRussell prusselltechgroup at gmail.com
Wed Mar 20 03:31:26 GMT 2019


I hope this reply is okay. I got here from the https://kate-editor.org/support/ page.

Regarding code folding for single line titles in asciidoc, I was successful in doing the 
following since kde 4 kate 3:

<context attribute="Normal"           lineEndContext="#stay"        name="_SingleLineTitle">
<RegExpr attribute="TitleSection0"  context="#stay"               String="^(={1})\s+\S(?:.*[^=])(?:\s+\1)?$"
            beginRegion="SingleLineFolding" endRegion="SingleLineFolding" />
<RegExpr attribute="TitleSection1"  context="#stay"               String="^(={2})\s+\S(?:.*[^=])(?:\s+\1)?$"
            beginRegion="SingleLineFolding" endRegion="SingleLineFolding" />
<RegExpr attribute="TitleSection2"  context="#stay"               String="^(={3})\s+\S(?:.*[^=])(?:\s+\1)?$"
            beginRegion="SingleLineFolding" endRegion="SingleLineFolding" />
<RegExpr attribute="TitleSection3"  context="#stay"               String="^(={4})\s+\S(?:.*[^=])(?:\s+\1)?$"
            beginRegion="SingleLineFolding" endRegion="SingleLineFolding" />
<RegExpr attribute="TitleSection4"  context="#stay"               String="^(={5})\s+\S(?:.*[^=])(?:\s+\1)?$"
            beginRegion="SingleLineFolding" endRegion="SingleLineFolding" />
</context>

However, it was recently broken.

Please see for more details and image: https://bugs.kde.org/show_bug.cgi?id=405585

-- 
Peg Russell


More information about the KWrite-Devel mailing list