1. What's the meaning of the parameter "FoldIndex" on the function TSynCustomFoldHighlighter.FoldLineLength() ?
IIRC (please test) the index of the fold. That is, if there are more than one fold opening in that line (e.g. in line 20) then
FoldLineLength(20,0) returns the amount of lines to the end of the first fold (leftmost) opening on that line
FoldLineLength(20,1) returns for the 2nd fold opening in that line.
This only accounts for folds that do NOT close on the same line. Folds closing on the same line are ignored, as they can not be folded.
2. What's FoldEndLine() for?. I guess this gives the end line, of the last block opened at the end of the indicated Line. But I find some errors on his work.
Returns the line number (or index, not sure 0 versus 1 based) of the line on which the closing token of the fold is.
It does so by using end- and min-levels.
Again it ignores anything that closes on the same line as it opens.
3. Is there some direct way for to obtain the quantity of ALL levels of folding? Accessing to TSynCustomFoldHighlighter.CodeFoldRange.CodeFoldStackSize, give me only the blocks opened with IncreaseLevel=TRUE.
Not sure what you mean?
If you mean that you open/close some folds with In-/De-creaseLevel, and you want
- the total of al that had In-/De-creaseLevel
- AND the total of all, including the ones without In-/De-creaseLevel
Then look at TSynPasSynRange
It adds the 2nd counter.
Also search for sfbIncludeDisabled (must be implemented by the highlighter)
I manage several blocks on the same line. That's why I need to read the column information.
Then you need to scan the line, when you need the info, and capture the info.
Pas HL does that. But it needs a lot of clean up, and the structures involved in that may change in future (Well maybe / maybe not so much...). But it should be in such way, that your sources can then be updated too. (I do recommend basic unit testing on that stuff)
Search for FCatchNodeInfo in the pas hl.
The info can be queried using
List := TextView.FoldProvider.NestedFoldsList; (see foldactions and stuff)
Unfortunately I havent worked on it in a while, so you need to search the sources.