Skip to content
Discussion options

You must be logged in to vote

You can, by manually setting buffer.fold_level (https://orbitalquark.github.io/textadept/api.html#buffer.fold_level), just like a lexer would.

Scintilla, the editing component Textadept uses, has more documentation on this field: https://scintilla.org/ScintillaDoc.html#SCI_SETFOLDLEVEL

A lexer returns a list of fold levels: https://github.com/orbitalquark/scintillua/blob/8070514fbcd14e117f289881994644497bc52e29/lexers/lexer.lua#L1337
Textadept uses those levels to assign to buffer.fold_level:

for line, level in pairs(folds) do buffer.fold_level[line] = level end

You could do something similar, but without a lexer.

However, you…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@asumbek
Comment options

Answer selected by asumbek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants