Differentiate special color indexes and others

This commit is contained in:
Daniel Imms
2023-07-28 16:32:05 -07:00
parent 79c1fff853
commit 5660c404f0
6 changed files with 44 additions and 45 deletions
+6 -6
View File
@@ -10,7 +10,7 @@ import { channels, color, css, NULL_COLOR } from 'common/Color';
import { EventEmitter } from 'common/EventEmitter';
import { Disposable } from 'common/Lifecycle';
import { IOptionsService, ITheme } from 'common/services/Services';
import { ColorIndex, ColorIndexValue, IColor } from 'common/Types';
import { ColorIndex, SpecialColorIndex, IColor, AllColorIndex } from 'common/Types';
interface IRestoreColorSet {
foreground: IColor;
@@ -176,12 +176,12 @@ export class ThemeService extends Disposable implements IThemeService {
this._onChangeColors.fire(this.colors);
}
public restoreColor(slot?: ColorIndex): void {
public restoreColor(slot?: AllColorIndex): void {
this._restoreColor(slot);
this._onChangeColors.fire(this.colors);
}
private _restoreColor(slot: ColorIndex | undefined): void {
private _restoreColor(slot: AllColorIndex | undefined): void {
// unset slot restores all ansi colors
if (slot === undefined) {
for (let i = 0; i < this._restoreColors.ansi.length; ++i) {
@@ -190,13 +190,13 @@ export class ThemeService extends Disposable implements IThemeService {
return;
}
switch (slot) {
case ColorIndexValue.FOREGROUND:
case SpecialColorIndex.FOREGROUND:
this._colors.foreground = this._restoreColors.foreground;
break;
case ColorIndexValue.BACKGROUND:
case SpecialColorIndex.BACKGROUND:
this._colors.background = this._restoreColors.background;
break;
case ColorIndexValue.CURSOR:
case SpecialColorIndex.CURSOR:
this._colors.cursor = this._restoreColors.cursor;
break;
default: