It would be great if the web editor supported folds of certain elements. Folds are sections of source code which can be folded to only show as a single line.
An example in Visual Studio Code:
Elements that I would like to fold:
multiline comments and multiline sections of single line comments
multiline code statements
multiline blocks and expressions
multiple successive imports
multiple successive show and/or set rules
possible long string literals
certain sections of markdown
all content between 2 headings of the same level
list/enum/terms shorthand syntax
math blocks if multiline
In a case where more than one fold icon would appear on the same line, the one which would fold the largest code section would take precedence. I.e.:
1 #set func(
2 ...
3 )
4 #set page("a4")
Should be folded to
1 #set func( // ...
5
Use Case
reduce visual clutter when editing large documents
ignore sections which are rarely edited (imports, prelude show/set rules)
ignore sections which are not being edited (finished sections, small script sections, etc.)
ignore sections which are being edited by other users in multiplayer scenarios
I have not used the multiplayer feature, but if text jumps around because of other users editing above one's own cursor this would certainly help
Description
It would be great if the web editor supported folds of certain elements. Folds are sections of source code which can be folded to only show as a single line.
An example in Visual Studio Code:
![image](https://github.com/typst/typst/assets/103939966/e7611ba7-6e94-40bd-90fb-19aa410e3dd4)
Elements that I would like to fold:
In a case where more than one fold icon would appear on the same line, the one which would fold the largest code section would take precedence. I.e.:
Should be folded to
Use Case