Skip to content

Fall back to the compare editor when no unified diff can be shown - #2843

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:fix-unified-diff-cancel-collision
Jul 31, 2026
Merged

Fall back to the compare editor when no unified diff can be shown#2843
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:fix-unified-diff-cancel-collision

Conversation

@vogella

@vogella vogella commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The marker status introduced in 4a9fc3f to say "the user canceled the computation, keep the text editor open" used status code 1, which is exactly the code of Status.CANCEL_STATUS. UnifiedDiffManager.open returns that plain cancel status when it cannot show a unified diff at all, namely when the editor has no annotation model and when validateEdit fails. Both were then mistaken for a user cancellation, so the fallback to the classic compare editor was skipped and the user was left looking at a plain text editor with no comparison in it.

The marker is now its own status object, compared by identity, so it cannot collide with any other cancel status. A test pins that it stays distinguishable from Status.CANCEL_STATUS.

Regression from 4a9fc3f, reported after it was merged.

The marker status that tells the caller "the user canceled, keep the text
editor" used code 1, which is exactly the code of Status.CANCEL_STATUS.
UnifiedDiffManager.open returns that plain cancel status when it cannot
show a unified diff at all, namely when the editor has no annotation model
or when validateEdit fails. Those were mistaken for a user cancellation,
so the fallback to the classic compare editor was skipped and the user was
left with a plain text editor showing no comparison.

The marker is now its own status object compared by identity, so it cannot
be confused with any other cancel status.

Regression from 4a9fc3f.
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   55m 47s ⏱️ +14s
 4 701 tests +1   4 679 ✅ +1   22 💤 ±0  0 ❌ ±0 
11 997 runs  +3  11 844 ✅ +3  153 💤 ±0  0 ❌ ±0 

Results for commit 0fad44e. ± Comparison against base commit 55d7ddf.

@vogella
vogella merged commit aab5b40 into eclipse-platform:master Jul 31, 2026
18 checks passed
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