Code folding in text files

Post Reply
cudatextforum
Posts: 1
Joined: 08.07.2022 20:01

Code folding in text files

Post by cudatextforum »

Is it possible to have code folding in simple text files? I would like to define some character sequences at the start of a line, like "~~" for folding start, and "**" for folding end. And then fold and unfold this block with a command or a mouse click in the code folding column.
main Alexey
Posts: 2300
Joined: 25.08.2021 18:15

Post by main Alexey »

yes, you can create lexer with any folding rules. see Lexer Tutorials:
https://github.com/Alexey-T/CudaText/tr ... /tutorials

>And then fold and unfold this block with a command or a mouse click in the code folding column.
yes, you can use Command Palette items for this:

- fold block at current line
- unfold block at current line
- toggle block at current line
Post Reply