Skip to content

Unified Diff: Severe performance degradation when editing with folded unchanged regions #2943

Description

@tobiasmelcher

Problem

When the preference "Fold unchanged regions, keeping a few lines of context around each change" is enabled and many unchanged regions are folded, editing the document becomes very slow. User input is barely registered or has a significant delay, making the editor practically unusable in this state.

Steps to Reproduce

  1. Enable Unified Diff in Preferences > Compare/Patch.
  2. Enable "Fold unchanged regions, keeping a few lines of context around each change".
  3. Open a file with many changes so that a large number of unchanged regions are folded.
  4. Start typing / editing in the editor.

Expected Behavior

Editing performance should be unaffected by the number of folded regions. User input should be processed at normal speed regardless of the folding state.

Actual Behavior

The editor becomes very slow. Keystrokes are delayed or dropped, making editing effectively impossible when many regions are folded.

Notes

This issue requires root-cause analysis. The folding mechanism likely triggers expensive recalculations (e.g. annotation recomputation, projection updates, or diff recalculation) on every document change, which does not scale with large numbers of folded regions.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions