Skip to content

Match SourceViewer canvas background to text widget - #3965

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:issue-3964-sourceviewer-gap-bg
Open

Match SourceViewer canvas background to text widget#3965
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:issue-3964-sourceviewer-gap-bg

Conversation

@vogella

@vogella vogella commented May 4, 2026

Copy link
Copy Markdown
Contributor

On dark editor themes a bright 1px vertical strip appears between the line numbers and the source code. The strip is the gap that RulerLayout leaves between the vertical ruler and the text widget; it exposes the parent Canvas of SourceViewer, whose background was never themed.

This change tracks the StyledText background and applies it to the canvas so the gap blends into the editor color scheme, and re-syncs on text widget paint events so preference-driven background changes propagate.

Fixes #3964

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Test Results

   858 files  ±0     858 suites  ±0   47m 27s ⏱️ - 10m 17s
 8 174 tests ±0   7 931 ✅ ±0  243 💤 ±0  0 ❌ ±0 
20 424 runs  ±0  19 768 ✅ ±0  656 💤 ±0  0 ❌ ±0 

Results for commit c60705f. ± Comparison against base commit f0ef795.

♻️ This comment has been updated with latest results.

@datho7561

Copy link
Copy Markdown

This looks good to me.

Something that might come up is that this "removes" the vertical line between the line number column and the text that some folks might be expecting. However, it looks like it was never intended to be there in the first place, and a few other code editors I looked at (VS Code, Zed) don't put a vertical line there.

The 1px gap between the vertical ruler and the text widget is rendered
by RulerLayout against the parent canvas, which kept its system default
background. On dark editor themes this surfaced as a bright vertical
strip between the line numbers and the source.

Track the StyledText background and apply it to the canvas, so the gap
blends into the editor color scheme. Re-syncs on text widget paint
events so preference-driven background changes propagate.

Fixes eclipse-platform#3964
@vogella
vogella force-pushed the issue-3964-sourceviewer-gap-bg branch from 0faf690 to c60705f Compare August 29, 2026 04:23
@vogella

vogella commented Aug 29, 2026

Copy link
Copy Markdown
Contributor Author
dark-theme-default-colors-before-after light-theme-dark-editor-colors-issue-3964-before-after light-theme-default-colors-before-after

@vogella
vogella marked this pull request as ready for review August 29, 2026 05:13
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.

The gap between the line numbers and code does not adapt to the configured source editor background colour

2 participants