Skip to content

Drop stale shadowed folds of the editor right away in Unified Diff - #3048

Open
subham-sahu06 wants to merge 2 commits into
eclipse-platform:masterfrom
subham-sahu06:issue-2943-unified-diff-fold-edit-performance
Open

subham-sahu06 wants to merge 2 commits into
eclipse-platform:masterfrom
subham-sahu06:issue-2943-unified-diff-fold-edit-performance

Conversation

@subham-sahu06

Copy link
Copy Markdown

While an unchanged region is collapsed, the folds of the editor it swallows are taken out of the projection model and remembered so they can be put back once the region is expanded. Out of the model their positions no longer follow the document, so a remembered fold is only restorable until the next edit. Such stale folds were nevertheless kept until their region was expanded.

Editors that re-add missing folds on every reconcile, such as the Generic Editor with its indentation folding, contribute a new copy of every swallowed fold after each edit, so the remembered folds piled up for as long as the region stayed collapsed, and every sync of the folds iterated all of them.

Drop a remembered fold as soon as the document was modified since it was taken out, whether or not its region is still collapsed. Which folds are put back does not change, since a stale fold was never restored.

Contributes to #2943

subham-sahu06 and others added 2 commits October 27, 2026 23:20
While an unchanged region is collapsed, the folds of the editor it
swallows are taken out of the projection model and remembered so they
can be put back once the region is expanded. Out of the model their
positions no longer follow the document, so a remembered fold is only
restorable until the next edit. Such stale folds were nevertheless kept
until their region was expanded.

Editors that re-add missing folds on every reconcile, such as the
Generic Editor with its indentation folding, contribute a new copy of
every swallowed fold after each edit, so the remembered folds piled up
for as long as the region stayed collapsed, and every sync of the folds
iterated all of them.

Drop a remembered fold as soon as the document was modified since it
was taken out, whether or not its region is still collapsed. Which folds
are put back does not change, since a stale fold was never restored.

Contributes to eclipse-platform#2943

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant