Skip to content

Fixes editor.findMatch ... Foreground vs HighlightForeground #321195 - #321258

Closed
Piyush Chouhan (Piyush142) wants to merge 4 commits into
microsoft:mainfrom
Piyush142:bug_fix
Closed

Piyush Chouhan (Piyush142) wants to merge 4 commits into
microsoft:mainfrom
Piyush142:bug_fix

Conversation

@Piyush142

@Piyush142 Piyush Chouhan (Piyush142) commented Jun 13, 2026 •

Copy link
Copy Markdown

Fixes #228782

Fixes swapped foreground color handling for editor find matches.

editor.findMatchForeground is intended to style the current/active find match, while editor.findMatchHighlightForeground is intended to style the other find matches. The theming participant had these two foreground colors wired to the opposite inline decoration classes, causing the active match and non-active matches to receive each other’s text colors.

This change updates the CSS rule generation so:

  • editor.findMatchForeground applies to .currentFindMatchInline
  • editor.findMatchHighlightForeground applies to .findMatchInline

It also removes the transparency requirement from editor.findMatchHighlightForeground, since this is a foreground color and should not be validated like an overlay/background color.

Also removes the needsTransparency metadata from editor.findMatchHighlightForeground. This token controls text color, not an overlay/background, so opaque colors should be accepted by the Settings editor.

Copilot AI review requested due to automatic review settings June 13, 2026 08:07

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates find-match theming so the configured “current match” vs “other matches” foreground colors apply to the correct inline decoration classes, and adjusts color registration metadata for one find-match foreground token.

Changes:

  • Swap CSS rules so editorFindMatchForeground targets .currentFindMatchInline and editorFindMatchHighlightForeground targets .findMatchInline
  • Remove the extra boolean flag argument from editor.findMatchHighlightForeground color registration

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/platform/theme/common/colors/editorColors.ts Adjusts editor.findMatchHighlightForeground color token registration arguments/metadata
src/vs/editor/contrib/find/browser/findWidget.ts Fixes which inline match class receives current vs highlight foreground theming rules

@Piyush142

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@Piyush142

Copy link
Copy Markdown
Author

Alexandru Dima (@alexdima) Could you please review my PR. 🙏

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Duplicate of #270395

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editor-find Editor find operations

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swapped findMatch Foreground Colors

4 participants