Folding at keywords and whitespace #117
Replies: 3 comments 3 replies
-
Did you try
lex:add_fold_point(lexer.KEYWORD, 'SUB', 'END')
Lexers are case-sensitive. If your keywords are for 'SUB' and 'END', then the fold point should use the same case.
The error you are getting in that last example is due to the fact that that API is valid for 11.x, but not 10.8.
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Oh, I see. 'End Sub' is broken up into two parts: 'End', which is a fold end point, but the very next 'Sub' starts a new fold point. Other than writing your own fold function, this is not possible right now. I'll have to look into this.
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
neilsf
-
This should be fixed via orbitalquark/scintillua@83b52b0 in the Scintillua project (Textadept uses it for syntax highlighting). These changes should be in the next nightly build of Textadept.
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi
Disclaimer: I am not a Lua programmer.
I'm trying to write a custom lexer for a BASIC dialect that allows code blocks like this:
Now if I define the keywords "SUB" and "END" then syntax highlighting works fine, however I can't find a way to define folding.
I tried this:
It doesn't work, I think because "end sub" is not a keyword. I also tried:
It doesn't work either, I think becuase there is text content after "end".
I also tried to add keywords containing a space like this:
This also doesn't work, it gives an error message when launching Textadept.
Can you give me ideas on how it could be written? Thanks
Beta Was this translation helpful? Give feedback.
All reactions