mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 16:57:46 +00:00
Save settings to ~/.gemini/settings.json and optionally /your/workspace/.gemini/settings.json (#237)
This commit is contained in:
@@ -19,8 +19,9 @@ export interface ThemeDisplay {
|
||||
active: boolean;
|
||||
}
|
||||
|
||||
export const DEFAULT_THEME: Theme = VS2015;
|
||||
|
||||
class ThemeManager {
|
||||
private static readonly DEFAULT_THEME: Theme = VS2015;
|
||||
private readonly availableThemes: Theme[];
|
||||
private activeTheme: Theme;
|
||||
|
||||
@@ -35,7 +36,7 @@ class ThemeManager {
|
||||
XCode,
|
||||
ANSI,
|
||||
];
|
||||
this.activeTheme = ThemeManager.DEFAULT_THEME;
|
||||
this.activeTheme = DEFAULT_THEME;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,10 +53,8 @@ class ThemeManager {
|
||||
* Sets the active theme.
|
||||
* @param themeName The name of the theme to activate.
|
||||
*/
|
||||
setActiveTheme(themeName: string): void {
|
||||
const foundTheme = this.availableThemes.find(
|
||||
(theme) => theme.name === themeName,
|
||||
);
|
||||
setActiveTheme(themeName: string | undefined): void {
|
||||
const foundTheme = this.findThemeByName(themeName);
|
||||
|
||||
if (foundTheme) {
|
||||
this.activeTheme = foundTheme;
|
||||
@@ -64,6 +63,13 @@ class ThemeManager {
|
||||
}
|
||||
}
|
||||
|
||||
findThemeByName(themeName: string | undefined): Theme | undefined {
|
||||
if (!themeName) {
|
||||
return DEFAULT_THEME;
|
||||
}
|
||||
return this.availableThemes.find((theme) => theme.name === themeName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently active theme object.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user