microsoft / microsoft/vscode

In Global Search, a click on the result does not trigger editor.findMatchForeground(or background) change

Open
#334,998 0 comments 0 reactions 1 assignee Claimed by @osortega View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

## Environment
Does this issue occur when all extensions are disabled?: Yes


VS Code Version: 1.136.1

```
Version: 1.136.1 (Universal)
Commit: a44adf7f53e00964ab890f9f8758a334f1fc15bc
Date: 2026-09-03T05:06:41Z
Electron: 42.10.0
ElectronBuildId: 15109253
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
@github/copilot: 1.0.81-0
@github/copilot-sdk: 1.0.11
OS: Darwin x64 25.5.0
```

- OS Version: MacOS 26.5.1

## Problem

Image

* Expected
As soon as I click any line in the search result, the color(background and foreground) of the current match in the editor must change. The highlight works on the first navigation, then stops working on subsequent clicks.

* Actually happened
**The color changes only after I click the result twice.**

## Steps to Reproduce

1. Open any folder with clean settings.
```
code --user-data-dir /tmp/vscode-clean-test \
--extensions-dir /tmp/vscode-clean-extensions \
--disable-extensions sample-project
```
2. Setup the per-project color theme in the `{root}/.vscode/settings.json`.
```
{
"workbench.colorCustomizations": {
"editor.findMatchHighlightForeground": "#ff0000", // red
"editor.findMatchHighlightBackground": "#7178ff", // bright purple

"editor.findMatchForeground": "#ffff00", // yellow
"editor.findMatchBackground": "#00ffff" // cyan
}
}
```
3. Create a sample file with some texts.
```
south
east
north
west
east south north west north
south
north
```
4. Open Global Search (Command+Shift+F)
5. Search for "north" (any word with multiple occurrences is ok.)
6. In the search result panel, click each line by line.
7. See how the color of the currently selected match in the editor changes.

## Others

By the way, for the current search match, I wanted **yellow text** with cyan background(see the settings.json above) but why is the text color **red**?? It seems `editor.findMatchHighlightForeground` and `editor.findMatchForeground` are swapped.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.