input: Avoid painting unset gutter background#2572
Merged
Conversation
Contributor
Author
|
Thanks for merging the PR. I really appreciate it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #2411
Description
The line-number gutter is painted as a separate quad on top of the editor background.
When
editor.gutter.backgroundis unset, the current implementation falls back toeditor_background(). Since the editor already paints that background, translucent colors are composited twice in the gutter and make it appear darker than the text area.The fallback can also conflict with a background applied through the editor's
Styledimplementation because the gutter still paints the theme's editor background separately.This change paints the gutter background only when
editor.gutter.backgroundis explicitly configured. When it is unset, the editor background remains visible without an additional paint layer. Themes that define a dedicated gutter background continue to render it as before.Screenshots
Before:

After:

How to Test
cargo check -p gpui-component.cargo runand open the Editor story.editor.backgroundand noeditor.gutter.background.editor.gutter.backgroundand verify that the explicit gutter background is still rendered.Checklist
cargo runfor story tests related to the changes.