Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai d6835c2b2f fix(color-scheme): an unticked Foreground keeps the text visible
Unticking Foreground stored the cleared colour and wrote `transparent` into
the attribute's colour variable, so its tokens became invisible. A cleared
foreground now falls back to the default text colour; cleared backgrounds
and effects stay transparent.

Refs #4059
2026-11-18 08:45:07 +08:00
2 змінених файлів з 7 додано та 2 видалено

No files matched your search

+3
Переглянути файл
@@ -169,6 +169,9 @@ describe("color schemes", () => {
expect(regular).toContain("--syn-keyword-bold: var(--fw-code, 400) !important");
const cleared = schemeCss("theme-default", { light: { keyword: { background: CLEAR_COLOR } } }, root);
expect(cleared).toContain("--syn-keyword-bg: transparent !important");
// An unticked Foreground falls back to the default text colour instead of hiding the text.
const noForeground = schemeCss("theme-default", { light: { predefined: { foreground: CLEAR_COLOR } } }, root);
expect(noForeground).toContain("--syn-builtin: var(--fg-editor) !important");
const upright = schemeCss("theme-default", { light: { staticSymbol: { italic: false } } }, root);
expect(upright).toContain("--syn-static-italic: normal !important");
const pythonItalic = schemeCss("theme-default", { light: { pyStaticSymbol: { italic: true } } }, root);
+4 -2
Переглянути файл
@@ -605,9 +605,11 @@ export function overrideDeclarations(
const o = overrides[attr.id];
if (!o) continue;
if (setOrCleared(o.foreground) && attr.fg) {
out.push([attr.fg, o.foreground]);
// No foreground means the default text colour, not invisible text.
const fg = o.foreground === CLEAR_COLOR && attr.id !== "text" ? "var(--fg-editor)" : o.foreground!;
out.push([attr.fg, fg]);
// Terminal prefers `--terminal-ansi-*`; keep it in sync with console `--ansi-*`.
if (attr.fg.startsWith("--ansi-")) out.push([`--terminal-ansi-${attr.fg.slice("--ansi-".length)}`, o.foreground]);
if (attr.fg.startsWith("--ansi-")) out.push([`--terminal-ansi-${attr.fg.slice("--ansi-".length)}`, fg]);
}
if (setOrCleared(o.background) && attr.bg) out.push([attr.bg, o.background]);
if (setOrCleared(o.effectColor) && attr.effect) out.push([attr.effect, o.effectColor]);