You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
editor.removeManualFoldingRanges should support empty selection #266597
bugIssue identified by VS Code Team member as probable bugeditor-foldingEditor code folding issuesinsiders-releasedPatch has been released in VS Code Insidersteam-low-hangingLow effort issues team members can help fix. No external contributions will be accepted.verifiedVerification succeeded
Folding ranges will sometimes break when pasting over Folded ranges
the ranges will appear in the wrong location/don't show up at all editor.removeManualFoldingRanges does not fix it
nor does changing the language and sometimes even reloading
still happens even with "editor.foldingStrategy": "indentation"
found some solid repo steps
happens when pasting text over already recursively collapsed text
doesn't have to be JSON, happens in plaintext and TypeScript etc as well
You currently need to select the full text and run 'editor.removeManualFoldingRanges'
We should support the empt selection that deletes all manual folding ranges
Martin Aeschlimann (@aeschli) should make a new issue for supporting editor.removeManualFoldingRanges with empty selection
as that is not the issue I'm reporting
I'm reporting that folding ranges break when pasting large amount of text
We can change the label back, but I don't know how we would solve that in the near future. It's a sensitive area as user don't want to lose folded ranges.
We should support the empty selection that deletes all manual folding ranges
currently it does support the empty selection
in that it removes every range that intersects with the cursor
if no selection is made editor.getSelections() returns a empty 0width selection
so we could detect this single empty selection and replace it with a full document range selection editor.getModel()!.getFullModelRange()
but users probably already expect the current behaviour
so idk
maybe detect if no range intersects the empty selection?
bugIssue identified by VS Code Team member as probable bugeditor-foldingEditor code folding issuesinsiders-releasedPatch has been released in VS Code Insidersteam-low-hangingLow effort issues team members can help fix. No external contributions will be accepted.verifiedVerification succeeded
Activity
[-]Folding ranges breaking on paste[/-][+]Folded Folding ranges breaking on paste[/+][-]Folded Folding ranges breaking on paste[/-][+]editor.removeManualFoldingRanges should support empty selection[/+]aeschli commentedon Dec 10, 2025
You currently need to select the full text and run 'editor.removeManualFoldingRanges'
We should support the empt selection that deletes all manual folding ranges
RedCMD commentedon Dec 10, 2025
Martin Aeschlimann (@aeschli) should make a new issue for supporting
editor.removeManualFoldingRangeswith empty selectionas that is not the issue I'm reporting
I'm reporting that folding ranges break when pasting large amount of text
aeschli commentedon Dec 11, 2025
We can change the label back, but I don't know how we would solve that in the near future. It's a sensitive area as user don't want to lose folded ranges.
aeschli commentedon Dec 11, 2025
Also see #201431
RedCMD commentedon Dec 16, 2025
having a look into
editor.removeManualFoldingRangesvscode/src/vs/editor/contrib/folding/browser/folding.ts
Lines 1203 to 1215 in aac80a7
currently it does support the empty selection
in that it removes every range that intersects with the cursor
if no selection is made
editor.getSelections()returns a empty 0width selectionso we could detect this single empty selection and replace it with a full document range selection
editor.getModel()!.getFullModelRange()but users probably already expect the current behaviour
so idk
maybe detect if no range intersects the empty selection?
fix: remove all manual folding ranges when selection is empty
fix: combine innermost removal with full-range fallback
yogeshwaran-c commentedon Mar 25, 2026
Implemented a fix in #304793 that combines both approaches suggested here:
This way the command is always useful regardless of cursor position, and the behavior is intuitive in both cases.
fix: remove all manual folding ranges when selection is empty (micros…