Skip to content

auto expand folded regions when fold ranges become invalid#2581

Closed
thehogfather wants to merge 2 commits intocodemirror:masterfrom
thehogfather:folding-fix
Closed

auto expand folded regions when fold ranges become invalid#2581
thehogfather wants to merge 2 commits intocodemirror:masterfrom
thehogfather:folding-fix

Conversation

@thehogfather
Copy link
Copy Markdown

This addresses an issue where fold markers do nothing if a folded region is made invalid as a result of an undo or delete action. To reproduce:

  • Enter the following fragment
function () {

}
  • Fold the function
  • Delete the closing brace

Result is that the fold marker no longer expands the folded region, although one is still able to click text marker or indeed expand the fold by navigating the cursor into the region.

In an attempt to address this issue, this pull request expands a folded region when they become invalid.
Credits to @JeffryBooher for spotting the issue.

@marijnh
Copy link
Copy Markdown
Member

marijnh commented Feb 24, 2015

I am not sure how I failed to respond to this. Apologies for that. I think a more lightweight solution is to fix the unfold markers so that they work even if the foldable range is no longer there. Attached patch does this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants