refactor: retire tui.BuiltinThemes in favor of theming.List
Make internal/theming.List the single source of truth for themes:
- Drop tui.BuiltinThemes, tui.ThemeByID, and the NvChadTheme field on
tui.Theme. tui.Theme is now a thin {ID, Name} display value.
- Wizard populates its dropdown from theming.List() and uses
DisplayName for the label.
- neovim.resolvedTheme uses theming.Get (with theming.List()[0] as a
fallback) instead of a caller-supplied []tui.Theme slice.
- neovim.New signature loses the themes []tui.Theme parameter; update
cmd/archduino/main.go and all neovim tests to match.
Break the resulting neovim→theming import cycle (theming previously
imported neovim for WriteChadrc) by inverting the dependency:
theming exposes a ChadrcWriter function hook, and neovim registers
its WriteChadrc into it via package init. The theming test stubs
ChadrcWriter directly to exercise the chadrc-rewrite branch without
pulling neovim in and re-creating the cycle.
Delete the now-obsolete TestBuiltinThemesCarryNvChadName / TestThemeByID*
tests in internal/tui/state_test.go — their coverage lives in the
theming package's own tests.
This commit is contained in:
@@ -57,7 +57,7 @@ func buildRegistry(cfg config.Config, themeID string) (*module.Registry, error)
|
||||
themes.New(cfg.Themes),
|
||||
arduinocli.New(cfg.ArduinoCLI, runner),
|
||||
shellconfig.New(cfg.ShellConfig),
|
||||
neovim.New(cfg.Neovim, themeID, tui.BuiltinThemes, pm, git),
|
||||
neovim.New(cfg.Neovim, themeID, pm, git),
|
||||
renode.New(cfg.Renode, pm, yay),
|
||||
}
|
||||
for _, m := range mods {
|
||||
|
||||
Reference in New Issue
Block a user