Skip to content

Commit d18d1aa

Browse files
committed
Render neovim.lua / aether.zed.json / vscode.json on every apply path
Every apply path except `aether --generate` passed a bare theme.Settings{} (zero value) to writer.ApplyTheme. Settings.IncludeNeovim, IncludeZed and IncludeVscode are all bool, so the zero value silently skipped all three optional templates. Users running --import-colors-toml, --import-base16, --apply-blueprint, aether://apply web links, the GUI confirm dialog, and the as_omarchy_theme install all got a half-applied theme with no neovim.lua / aether.zed.json / vscode.json — even though --generate produced them. Added theme.DefaultApplySettings() returning the same defaults as --generate (zed/vscode/neovim on, gtk off) and routed all 6 bare-Settings call sites through it. ExportTheme keeps its explicit per-app toggles.
1 parent 5417ff8 commit d18d1aa

6 files changed

Lines changed: 22 additions & 7 deletions

File tree

app.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ func (a *App) ApplyBlueprint(name string) (*theme.ApplyResult, error) {
507507
a.state.Adjustments = a.adjustmentsFromBlueprint(bp)
508508
a.state.AppOverrides = a.appOverridesFromBlueprint(bp)
509509

510-
return a.writer.ApplyTheme(a.state, theme.Settings{})
510+
return a.writer.ApplyTheme(a.state, theme.DefaultApplySettings())
511511
}
512512

513513
// BlueprintExists checks whether a blueprint with the given name already exists.

cli/blueprints.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func runApplyBlueprint(args []string, templatesFS embed.FS) int {
120120
AppOverrides: bp.AppOverrides,
121121
}
122122

123-
settings := theme.Settings{}
123+
settings := theme.DefaultApplySettings()
124124
fmt.Printf("Applying blueprint: %s\n", bp.Name)
125125
result, err := writer.ApplyTheme(state, settings)
126126
if err != nil {

cli/imports.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func runImportBase16(args []string, templatesFS embed.FS) int {
137137
}
138138

139139
fmt.Println("Applying theme...")
140-
result, err := writer.ApplyTheme(state, theme.Settings{})
140+
result, err := writer.ApplyTheme(state, theme.DefaultApplySettings())
141141
if err != nil {
142142
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
143143
return 1
@@ -201,7 +201,7 @@ func runImportColorsToml(args []string, templatesFS embed.FS) int {
201201
}
202202

203203
fmt.Println("Applying theme...")
204-
result, err := writer.ApplyTheme(state, theme.Settings{})
204+
result, err := writer.ApplyTheme(state, theme.DefaultApplySettings())
205205
if err != nil {
206206
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
207207
return 1

cli/url_handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ func runSilentApply(imp *pending.Import, templatesFS embed.FS) int {
229229
}
230230

231231
fmt.Println("Applying theme silently...")
232-
result, err := writer.ApplyTheme(state, theme.Settings{})
232+
result, err := writer.ApplyTheme(state, theme.DefaultApplySettings())
233233
if err != nil {
234234
fmt.Fprintf(os.Stderr, "Error: apply: %v\n", err)
235235
return 1
@@ -317,7 +317,7 @@ func runOmarchyInstall(imp *pending.Import, templatesFS embed.FS) int {
317317
}
318318

319319
fmt.Printf("Installing omarchy theme %q to: %s\n", imp.OmarchyThemeName, targetDir)
320-
if err := writer.GenerateOnly(state, theme.Settings{}, targetDir); err != nil {
320+
if err := writer.GenerateOnly(state, theme.DefaultApplySettings(), targetDir); err != nil {
321321
fmt.Fprintf(os.Stderr, "Error: render templates: %v\n", err)
322322
return 1
323323
}

external_import.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (a *App) ConfirmExternalImport() error {
190190
}
191191
}
192192

193-
result, err := a.writer.ApplyTheme(a.state, theme.Settings{})
193+
result, err := a.writer.ApplyTheme(a.state, theme.DefaultApplySettings())
194194
if err != nil {
195195
return fmt.Errorf("apply: %w", err)
196196
}

internal/theme/writer.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,21 @@ type Settings struct {
6161
VideoCpuMode bool `json:"videoCpuMode"`
6262
}
6363

64+
// DefaultApplySettings returns the same defaults `aether --generate` uses:
65+
// Zed / VSCode / Neovim templates rendered, GTK opt-in. Use this anywhere
66+
// the user is applying a theme without picking per-app toggles explicitly
67+
// (CLI imports, web-handler silent path, blueprint apply, GUI confirm
68+
// dialog) so behavior is consistent — a bare `Settings{}` would silently
69+
// drop neovim.lua and aether.zed.json from the output.
70+
func DefaultApplySettings() Settings {
71+
return Settings{
72+
IncludeGtk: false,
73+
IncludeZed: true,
74+
IncludeVscode: true,
75+
IncludeNeovim: true,
76+
}
77+
}
78+
6479
// ApplyResult is returned by ApplyTheme with the outcome of theme application.
6580
type ApplyResult struct {
6681
Success bool `json:"success"`

0 commit comments

Comments
 (0)