Skip to content

Trim detailed-diff highlight ending in trailing spaces - #2981

Open
tobiasmelcher wants to merge 1 commit into
eclipse-platform:masterfrom
tobiasmelcher:d031119/fix-detailed-diff-trailing-space-clipping
Open

tobiasmelcher wants to merge 1 commit into
eclipse-platform:masterfrom
tobiasmelcher:d031119/fix-detailed-diff-trailing-space-clipping

Conversation

@tobiasmelcher

Copy link
Copy Markdown
Contributor

Follow-up to the trailing-spaces limitation noted by @vogella in review of #2965.

createDetailedDiffBackgroundRanges computes its labelLength limit with stripTrailing(), which removes trailing spaces. The old all-or-nothing bounds check (expandedStart + expandedLength <= labelLength) dropped a detailed-diff highlight completely when it reached into that stripped region — a detailed diff ending in trailing spaces lost its whole highlight instead of being trimmed.

The length is now clamped to labelLength via the shared clampDetailedDiffLength helper, so the highlight is trimmed to the visible label, mirroring the trailing-newline fix from #2965.

Reviewed with the help of Claude Code.

@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

    54 files  ±0      54 suites  ±0   1h 0m 11s ⏱️ + 3m 32s
 4 850 tests +1   4 828 ✅ +1   22 💤 ±0  0 ❌ ±0 
12 441 runs  +3  12 287 ✅ +3  154 💤 ±0  0 ❌ ±0 

Results for commit c86669a. ± Comparison against base commit 8fa7d88.

♻️ This comment has been updated with latest results.

@vogella vogella left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The label is drawn with its trailing spaces stripped, so a detailed
diff reaching into that region overshot the space-stripped labelLength
and was dropped completely instead of being trimmed. The length is now
clamped to labelLength via clampDetailedDiffLength, so the highlight is
trimmed to the visible label.

Reviewed with the help of Claude Code.
@tobiasmelcher
tobiasmelcher force-pushed the d031119/fix-detailed-diff-trailing-space-clipping branch from 1140f0f to c86669a Compare October 1, 2026 15:52
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.

2 participants