Skip to content

Commit 7ea8fbb

Browse files
authored
fix wrong colors when editor findMatchForeground is not defined (microsoft#213686)
* fix css
1 parent 826a005 commit 7ea8fbb

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/vs/editor/contrib/find/browser/findWidget.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -232,21 +232,13 @@
232232
background-color: var(--vscode-editor-findMatchHighlightBackground);
233233
}
234234

235-
.monaco-editor .findMatchInline {
236-
color: var(--vscode-editor-findMatchHighlightForeground);
237-
}
238-
239235
.monaco-editor .currentFindMatch {
240236
background-color: var(--vscode-editor-findMatchBackground);
241237
border: 2px solid var(--vscode-editor-findMatchBorder);
242238
padding: 1px;
243239
box-sizing: border-box;
244240
}
245241

246-
.monaco-editor .currentFindMatchInline {
247-
color: var(--vscode-editor-findMatchForeground);
248-
}
249-
250242
.monaco-editor .findScope {
251243
background-color: var(--vscode-editor-findRangeHighlightBackground);
252244
}

src/vs/editor/contrib/find/browser/findWidget.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/c
3535
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
3636
import { INotificationService } from 'vs/platform/notification/common/notification';
3737
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
38-
import { asCssVariable, contrastBorder, editorFindMatchHighlightBorder, editorFindRangeHighlightBorder, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from 'vs/platform/theme/common/colorRegistry';
38+
import { asCssVariable, contrastBorder, editorFindMatchForeground, editorFindMatchHighlightBorder, editorFindMatchHighlightForeground, editorFindRangeHighlightBorder, inputActiveOptionBackground, inputActiveOptionBorder, inputActiveOptionForeground } from 'vs/platform/theme/common/colorRegistry';
3939
import { registerIcon, widgetClose } from 'vs/platform/theme/common/iconRegistry';
4040
import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
4141
import { ThemeIcon } from 'vs/base/common/themables';
@@ -1409,4 +1409,12 @@ registerThemingParticipant((theme, collector) => {
14091409
if (hcBorder) {
14101410
collector.addRule(`.monaco-editor .find-widget { border: 1px solid ${hcBorder}; }`);
14111411
}
1412+
const findMatchForeground = theme.getColor(editorFindMatchForeground);
1413+
if (findMatchForeground) {
1414+
collector.addRule(`.monaco-editor .findMatchInline { color: ${findMatchForeground}; }`);
1415+
}
1416+
const findMatchHighlightForeground = theme.getColor(editorFindMatchHighlightForeground);
1417+
if (findMatchHighlightForeground) {
1418+
collector.addRule(`.monaco-editor .currentFindMatchInline { color: ${findMatchHighlightForeground}; }`);
1419+
}
14121420
});

0 commit comments

Comments
 (0)