bsegraves / custom-folds

Atom plugin for defining custom markers for foldable regions.
MIT License
24 stars 9 forks source link

Functions in custom folds default to open. #16

Open barnesew opened 8 years ago

barnesew commented 8 years ago

Whenever I collapse all recursively and then open up various folds, all the normal function folds are expanded upon me opening a container-like custom fold. The following picture shows this:

image

I am comparing this against how notepad++ handles custom folds defined as //{ and //}.

marcel0ll commented 8 years ago

I think this is due to how atom unfold api works

barnesew commented 8 years ago

Why would unfoldBufferRow() get called from expanding/collapsing a custom fold?

marcel0ll commented 8 years ago

Because its the api provided by atom to fold code. Custom Folds just folds and expands code in a custom marker

bsegraves commented 8 years ago

I definitely see what you're saying @AquioxSoftware. Unfortunately I don't know how to do with this the api that atom provides externally.

When unfolding, I'm simply calling editor.unfoldBufferRow(row). I don't know why it's choosing to also unfold the internal regions.