Skip to content

Conversation

@simon-id
Copy link
Contributor

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

@simon-id the Code OSS build is gone, could you please close and reopen the PR to trigger another build?

@simon-id simon-id closed this Jan 31, 2025
@simon-id simon-id reopened this Jan 31, 2025
@simon-id
Copy link
Contributor Author

@osortega done!

Copy link
Contributor

@osortega osortega left a comment

Choose a reason for hiding this comment

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

Thank you! ✨

@vs-code-engineering vs-code-engineering bot added this to the February 2025 milestone Feb 3, 2025
@osortega osortega merged commit 9856721 into microsoft:main Feb 7, 2025
11 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

4 participants