From 1b8cfe9e99e7b97069580a2e8aaa8cf1abb56d31 Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Fri, 13 Jun 2025 06:49:59 -0500 Subject: wip: refactoring tui --- packages/tui/internal/theme/manager.go | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'packages/tui/internal/theme') diff --git a/packages/tui/internal/theme/manager.go b/packages/tui/internal/theme/manager.go index 3e351f7f1..c54ed1119 100644 --- a/packages/tui/internal/theme/manager.go +++ b/packages/tui/internal/theme/manager.go @@ -6,6 +6,8 @@ import ( "slices" "strings" "sync" + + "github.com/alecthomas/chroma/v2/styles" // "github.com/alecthomas/chroma/v2/styles" ) @@ -45,22 +47,7 @@ func RegisterTheme(name string, theme Theme) { func SetTheme(name string) error { globalManager.mu.Lock() defer globalManager.mu.Unlock() - // delete(styles.Registry, "charm") - - // Handle custom theme - // if name == "custom" { - // cfg := config.Get() - // if cfg == nil || cfg.TUI.CustomTheme == nil || len(cfg.TUI.CustomTheme) == 0 { - // return fmt.Errorf("custom theme selected but no custom theme colors defined in config") - // } - // - // customTheme, err := LoadCustomTheme(cfg.TUI.CustomTheme) - // if err != nil { - // return fmt.Errorf("failed to load custom theme: %w", err) - // } - // - // // Register the custom theme - // globalManager.themes["custom"] = customTheme + delete(styles.Registry, "charm") if _, exists := globalManager.themes[name]; !exists { return fmt.Errorf("theme '%s' not found", name) -- cgit v1.2.3