Is there a way to programmatically set fold start and end without a lexer? #702
-
|
The title says it all... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You can, by manually setting 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 Line 140 in f8da4d8 You could do something similar, but without a lexer. However, you'll need to make sure that the buffer you're trying to change fold levels for does not have a lexer with a folder, or else it will overwrite your changes. |
Beta Was this translation helpful? Give feedback.
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:textadept/core/lexer.lua
Line 140 in f8da4d8
You could do something similar, but without a lexer.
However, you…