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
[folding] Manual folding range not useful after copy-paste #201431
Does this issue occur when all extensions are disabled?: Yes
I saw it with indentation-based folding . This issue has been in VSC since 1st release, it does happen relatively often and is annoying .
Steps to Reproduce:
Create text editor tab and add this:
1
2
3
4
5
6
7
8
1
2
4
6
8
Run editor.foldAll .
Copy the 1st tree, then select the 2nd tree and run Paste .
Try folding on the pasted tree .
The example case may be showing only a part of it, i wouldn't be surprised if there are multiple such issues, including ones which don't involve copying .
This doesn't get fixed with Refresh, but may get fixed if you cut and paste the part which made the issue show up .
Probably the same: #171413 and there is probably more .
The code reapplies the folded ranges, 2-3 becomes a manually folded range.
That feature was added to avoid loosing folded ranges. I agree that in this example it is not useful.
There's a command Remove Manual Folding Ranges to remove that range again.
changed the title [-]Folding regions are determined wrong after copy-paste[/-][+][folding] Manual folding range not useful after copy-paste[/+]on Jan 8, 2024
Activity
RedCMD commentedon Dec 23, 2023
I've had this issue with many json files before
and I think another language as well?
irvnriir commentedon Jan 3, 2024
also, ffs, add ability to disable folding of trailing whitespace in indentation-based folding .
aeschli commentedon Jan 8, 2024
After folding it looks like this:

Correct?
The code reapplies the folded ranges, 2-3 becomes a manually folded range.
That feature was added to avoid loosing folded ranges. I agree that in this example it is not useful.
There's a command
Remove Manual Folding Rangesto remove that range again.[-]Folding regions are determined wrong after copy-paste[/-][+][folding] Manual folding range not useful after copy-paste[/+]irvnriir commentedon Jan 8, 2024
the "not useful", Backlog..
pbaksa commentedon Feb 16, 2026
The incorrect folding range is remembered even after computer restart, only cut&paste fixes it.