I'd like to implement some very simple folding for a stc.StyledTextCtrl. I assume the folding is based on the lexer and I'm using the STC_LEX_SQL lexer, which I doubt has any folding defined, but I don't know where to look.
Markers would look like this:
- -- First Query (unfolded)
SELECT * FROM tablename1
WHERE fieldname1 = 'text1'
break
+ Second Query (folded)
- -- Third Query (unfolded)
SELECT * FROM table2
WHERE fieldname2 = 'text2'
* '-- and text' is an SQL comment
* 'break' indicates query separation.
* if a comment is given on the first line, it is shown when query is folded.
So the fold logic would look like this:
is_fold_point = False
if position == first_line_of_text or position == first_line_after_break:
is_fold_point = True
Randall