Also if you want to emulate SynEdit.
The above is about nested folds.
SynEdit also has overlapping folds
FoldApiCall({y=} 10, {y2=} 19, {x=} 15);
FoldApiCall({y=} 17, {y2=} 24, {x=} 15);
Which also creates 2 foldblocks (though the [+] of the 2nd is not visible, as it is in the 1st fold)
----------------
And SynEdit has "hide". It is similar to fold, but displays different.
I do not see in your API how to pass in this info.
Select text, and it will show a [-] for the text. But when you click [-] it displays a different symbol [v], and on the line above.)
Reason: If you click [-] the line, on which the [-] was is itself hidden. So it is not possible to display a [+] on this line. Hence the Symbol moves one line up.
If you do that on line 1 of the file, then there is no line above, so it goes to the line below [^]
---------------
The rest depends on the code using the API, and the code providing info what can be folded.
E.g. right click SynEdits fold gutter and see the context menu.
I assume the providing what can be folded is part of a different API?