Add editor.findMatchForeground (#213497)

* feature: make find decoration foreground color configurable
This commit is contained in:
Simon Siefke 2024-05-27 17:48:07 +02:00 committed by GitHub
parent 8b3f19eacd
commit f7cead6b72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 20 additions and 0 deletions

View File

@ -128,8 +128,10 @@
"--vscode-dropdown-listBackground",
"--vscode-editor-background",
"--vscode-editor-findMatchBackground",
"--vscode-editor-findMatchForeground",
"--vscode-editor-findMatchBorder",
"--vscode-editor-findMatchHighlightBackground",
"--vscode-editor-findMatchHighlightForeground",
"--vscode-editor-findMatchHighlightBorder",
"--vscode-editor-findRangeHighlightBackground",
"--vscode-editor-findRangeHighlightBorder",

View File

@ -288,6 +288,7 @@ export class FindDecorations implements IDisposable {
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
zIndex: 13,
className: 'currentFindMatch',
inlineClassName: 'currentFindMatchInline',
showIfCollapsed: true,
overviewRuler: {
color: themeColorFromId(overviewRulerFindMatchForeground),
@ -304,6 +305,7 @@ export class FindDecorations implements IDisposable {
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
zIndex: 10,
className: 'findMatch',
inlineClassName: 'findMatchInline',
showIfCollapsed: true,
overviewRuler: {
color: themeColorFromId(overviewRulerFindMatchForeground),

View File

@ -232,6 +232,10 @@
background-color: var(--vscode-editor-findMatchHighlightBackground);
}
.monaco-editor .findMatchInline {
color: var(--vscode-editor-findMatchHighlightForeground);
}
.monaco-editor .currentFindMatch {
background-color: var(--vscode-editor-findMatchBackground);
border: 2px solid var(--vscode-editor-findMatchBorder);
@ -239,6 +243,10 @@
box-sizing: border-box;
}
.monaco-editor .currentFindMatchInline {
color: var(--vscode-editor-findMatchForeground);
}
.monaco-editor .findScope {
background-color: var(--vscode-editor-findRangeHighlightBackground);
}

View File

@ -141,10 +141,18 @@ export const editorFindMatch = registerColor('editor.findMatchBackground',
{ light: '#A8AC94', dark: '#515C6A', hcDark: null, hcLight: null },
nls.localize('editorFindMatch', "Color of the current search match."));
export const editorFindMatchForeground = registerColor('editor.findMatchForeground',
{ light: null, dark: null, hcDark: null, hcLight: null },
nls.localize('editorFindMatchForeground', "Text color of the current search match."));
export const editorFindMatchHighlight = registerColor('editor.findMatchHighlightBackground',
{ light: '#EA5C0055', dark: '#EA5C0055', hcDark: null, hcLight: null },
nls.localize('findMatchHighlight', "Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."), true);
export const editorFindMatchHighlightForeground = registerColor('editor.findMatchHighlightForeground',
{ light: null, dark: null, hcDark: null, hcLight: null },
nls.localize('findMatchHighlightForeground', "Foreground color of the other search matches."), true);
export const editorFindRangeHighlight = registerColor('editor.findRangeHighlightBackground',
{ dark: '#3a3d4166', light: '#b4b4b44d', hcDark: null, hcLight: null },
nls.localize('findRangeHighlight', "Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."), true);