I need to preserve the sub-foldings on folding/unfolding the mother (super) ones.
Kindly find this Illustrative Example that will help you understand what I mean.
I need to preserve the sub-foldings on folding/unfolding the mother (super) ones.
Kindly find this Illustrative Example that will help you understand what I mean.
I don’t think it’s really possible, there’s no API event to detect when a region is being folded or unfolded (via the view.fold view.unfold API), so unless the plugin would be the only one used to fold and unfold (such that it can guarantee the fold state itself), then there is no way to refold inner regions when the outer region is unfolded.
Just wanted to point out, that some of the recent relases has added the view.is_folded(region) and view.folded_regions() methods. (They are not in the doc yet, but in sublime.py.)
So it should not be so problematic to hook into fold/unfold, invisible mark these regions (via view.add_region) while folding and refold them while unfolding.