Repository navigation
Closed
Labels
bugIssue identified by VS Code Team member as probable bugeditor-findEditor find operationsinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded
Milestone
Description
Type: Bug
The editor.findMatchForeground and editor.findMatchHighlightForeground colors in workbench.colorCustomizations appear to be swapped when applied.
The descriptions say:
- editor.findMatchForeground: Text color of the current search match.
- editor.findMatchHighlightForeground: Foreground color of the other search matches.
I'm using the default Dark+ theme.
I want the current search match to have black text, so I set editor.findMatchForeground to "#000000", but this makes text in other matches turn black, not the current match.
I can get what I want, instead, by setting editor.findMatchHighlightForeground to "#000000", which is unexpected.
The result is the same when disabling all extensions.
Here are two screenshots to show the two configurations and their result.
VS Code version: Code 1.93.1 (Universal) (38c31bc, 2024-09-11T17:20:05.685Z)
OS version: Darwin arm64 23.6.0
Modes:
System Info
| Item | Value |
|---|---|
| CPUs | Apple M3 Pro (11 x 2400) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | 1, 2, 2 |
| Memory (System) | 18.00GB (0.67GB free) |
| Process Argv | --crash-reporter-id 03efdb6c-33ed-4f1d-8fbf-ed5efe9bd46e |
| Screen Reader | no |
| VM | 0% |
Extensions (35)
| Extension | Author (truncated) | Version |
|---|---|---|
| xml | Dot | 2.5.1 |
| terraform | has | 2.32.3 |
| jenkinsfile-support | ivo | 1.1.0 |
| search-editor-apply-changes | jak | 0.1.1 |
| vscode-edit-csv | jan | 0.10.0 |
| eml | lei | 0.4.0 |
| MagicPython | mag | 1.1.0 |
| vscode-autohotkey-plus-plus | mar | 6.0.0 |
| rainbow-csv | mec | 3.12.0 |
| dotenv | mik | 1.0.1 |
| vscode-docker | ms- | 1.29.2 |
| vscode-language-pack-it | MS- | 1.93.2024091109 |
| csharp | ms- | 2.45.25 |
| vscode-dotnet-runtime | ms- | 2.1.5 |
| debugpy | ms- | 2024.10.0 |
| isort | ms- | 2023.10.1 |
| python | ms- | 2024.14.1 |
| vscode-pylance | ms- | 2024.9.1 |
| jupyter | ms- | 2024.8.1 |
| jupyter-keymap | ms- | 1.1.2 |
| jupyter-renderers | ms- | 1.0.19 |
| vscode-jupyter-cell-tags | ms- | 0.1.9 |
| vscode-jupyter-slideshow | ms- | 0.1.6 |
| remote-containers | ms- | 0.384.0 |
| remote-ssh | ms- | 0.114.3 |
| remote-ssh-edit | ms- | 0.86.0 |
| remote-wsl | ms- | 0.88.3 |
| vscode-remote-extensionpack | ms- | 0.25.0 |
| powershell | ms- | 2024.2.2 |
| remote-explorer | ms- | 0.4.3 |
| remote-server | ms- | 1.5.2 |
| text-power-tools | qcz | 1.49.0 |
| jinjahtml | sam | 0.20.0 |
| vba-formatter | thr | 0.0.3 |
| vscode-nginx | wil | 0.7.2 |
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
f3je6385:31013174
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
newcmakeconfigv2:31071590
impr_priority:31102340
nativerepl2:31139839
refactort:31108082
pythonrstrctxt:31112756
flightc:31134773
wkspc-onlycs-t:31132770
nativeloc1:31134641
wkspc-ranged-c:31125598
fje88620:31121564
Reacted by fvrests and simon-id
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugeditor-findEditor find operationsinsiders-releasedPatch has been released in VS Code InsidersverifiedVerification succeeded
Activity
simon-id commentedon Jan 16, 2025
I confirm this also happens for me, although I didn't notice it at first because I set the same color for both
findMatchForegroundandfindMatchHighlightForeground.In the end we can't know if it's the foreground or the background that has been swapped. Is
highlightsupposed to represent the currently selected findmatch ? or all the other findmatch ?Kalmaegi commentedon Apr 5, 2025
same problem, The effects of these two fields are opposite to the documentation description. I'm wondering if a PR to fix this issue would be acceptable, but making the change would affect all existing themes.
https://code.visualstudio.com/api/references/theme-color#:~:text=editor.findMatchHighlightForeground%3A%20Foreground%20color%20of%20the%20other%20search%20matches.
fix (microsoft#228782)
Swap `findMatchHighlightForeground` with `findMatchForeground`
dmitrivMS commentedon Sep 28, 2026
Potential fix from the duplicate: #321258
editorFind: fix swapped findMatch foreground colors (#228782) (#270395)
vs-code-engineering commentedon Oct 29, 2026
Sharing media and context from merged PR #270395 for verification:
Summary
Fixes an issue where the
editor.findMatchForegroundandeditor.findMatchHighlightForegroundcolor settings were swapped.Problem
The find match foreground colors were incorrectly assigned:
editor.findMatchForeground(documented as “current search match”) was applied to other matches.editor.findMatchHighlightForeground(documented as “other search matches”) was applied to the current match.Solution
Swapped the CSS class selectors in
findWidget.ts:editor.findMatchForegroundnow correctly targets.currentFindMatchInline(current match)editor.findMatchHighlightForegroundnow correctly targets.findMatchInline(other matches)Before
After
Test Plan
editor.findMatchForegroundto a distinct color and verify it colors the current match.editor.findMatchHighlightForegroundto a distinct color and verify it colors other matches.Source PR: #270395