Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: workbench search use correct findMatch colors (fix #237909) #237910

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

simon-id
Copy link

@simon-id simon-id commented Jan 14, 2025

Motivation

Fixes: #237909

With this user configuration, find match text color are improperly rendered when using Workbench Search (not the widget search):

    "workbench.colorCustomizations": {
        "editor.findMatchHighlightForeground": "#000000",
        "editor.findMatchHighlightBackground": "#ffffb4",
        "editor.findMatchForeground": "#000000",
        "editor.findMatchBackground": "#ff4cde"
    },

Before fix:

image

After fix:

image

Code changes

Add the inlineClassName field to the Workbench Search ModelDecorationOptions to properly render the editor.findMatchForeground and editor.findMatchHighlightForeground colors.

This field is copied directly from the ModelDecorationOptions in src/vs/editor/contrib/find/browser/findDecorations.ts, as the widget search properly renders the foreground colors.

public static readonly _CURRENT_FIND_MATCH_DECORATION = ModelDecorationOptions.register({
description: 'current-find-match',
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
zIndex: 13,
className: 'currentFindMatch',
inlineClassName: 'currentFindMatchInline',
showIfCollapsed: true,
overviewRuler: {
color: themeColorFromId(overviewRulerFindMatchForeground),
position: OverviewRulerLane.Center
},
minimap: {
color: themeColorFromId(minimapFindMatch),
position: MinimapPosition.Inline
}
});
public static readonly _FIND_MATCH_DECORATION = ModelDecorationOptions.register({
description: 'find-match',
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
zIndex: 10,
className: 'findMatch',
inlineClassName: 'findMatchInline',
showIfCollapsed: true,
overviewRuler: {
color: themeColorFromId(overviewRulerFindMatchForeground),
position: OverviewRulerLane.Center
},
minimap: {
color: themeColorFromId(minimapFindMatch),
position: MinimapPosition.Inline
}
});

@simon-id
Copy link
Author

Failing test looks unrelated and only happen on windows ? looks like a flaky tests but I don't know how to restart the job:

vscode API - network proxy support
       basic auth:
     Error: Unexpected status code (expected 418): 200

https://dev.azure.com/vscode/VSCode/_build/results?buildId=141565&view=logs&j=e5ed5edc-5ec6-5bfb-d1cb-ed7e8a6cb5eb&t=591b7a1b-7322-5ac3-b08e-eb7fe6b0ff14

@simon-id simon-id changed the title search: fix workbench findMatch colors (fix #237909) fix(search): workbench findMatch colors (fix #237909) Jan 14, 2025
@simon-id simon-id changed the title fix(search): workbench findMatch colors (fix #237909) fix(search): workbench search use correct findMatch colors (fix #237909) Jan 14, 2025
@simon-id simon-id changed the title fix(search): workbench search use correct findMatch colors (fix #237909) fix: workbench search use correct findMatch colors (fix #237909) Jan 14, 2025
@roblourens roblourens assigned osortega and unassigned roblourens Jan 15, 2025
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.

Workbench search does not use correct findMatch foreground colors
3 participants