Compare commits

..

2 Commits

Author SHA1 Message Date
Hayden Hargreaves
d270927ff7 chore: agents are primary now, I like this more
All checks were successful
Run Test Suite / test (push) Successful in 36s
2026-04-08 17:28:47 -07:00
Hayden Hargreaves
e27c7560a2 fix: fixed issues the @janitor found 2026-04-08 17:28:01 -07:00
8 changed files with 8 additions and 38 deletions

View File

@ -1,6 +1,6 @@
--- ---
description: Identifies dead code, unused dependencies, and structural bloat in Go projects description: Identifies dead code, unused dependencies, and structural bloat in Go projects
mode: subagent mode: primary
model: openai/gpt-5.4-mini model: openai/gpt-5.4-mini
temperature: 0.1 temperature: 0.1
permissions: permissions:

View File

@ -1,6 +1,6 @@
--- ---
description: Reviews Go code for idiomatic patterns, performance, and concurrency safety description: Reviews Go code for idiomatic patterns, performance, and concurrency safety
mode: subagent mode: primary
model: openai/gpt-5.4 model: openai/gpt-5.4
temperature: 0.1 temperature: 0.1
permission: permission:

View File

@ -1,6 +1,6 @@
--- ---
description: Generates and reviews Go tests, specializing in table-driven patterns and teatest TUI validation description: Generates and reviews Go tests, specializing in table-driven patterns and teatest TUI validation
mode: subagent mode: primary
model: openai/gpt-5.3-codex model: openai/gpt-5.3-codex
temperature: 0.1 temperature: 0.1
permission: permission:

View File

@ -51,7 +51,6 @@ type Model struct {
registers map[rune]core.Register // name -> register registers map[rune]core.Register // name -> register
// Visual styles // Visual styles
// currentTheme string // Name of current theme
themes map[string]theme.EditorTheme themes map[string]theme.EditorTheme
syntax syntax.Engine syntax syntax.Engine
@ -186,7 +185,7 @@ func (m *Model) replayInsert() {
} }
} }
// TODO: Fix this shitty shit shit shit // TODO: This can't be the best way....
func (m *Model) processInsertKey(key string) { func (m *Model) processInsertKey(key string) {
win := m.ActiveWindow() win := m.ActiveWindow()
buf := m.ActiveBuffer() buf := m.ActiveBuffer()

View File

@ -20,7 +20,7 @@ func NewModelBuilder() *ModelBuilder {
var embededThemes map[string]theme.EditorTheme var embededThemes map[string]theme.EditorTheme
embededThemesJson, err := theme.LoadEmbeddedThemesJSON() embededThemesJson, err := theme.LoadEmbeddedThemesJSON()
if err == nil { if err == nil {
embededThemes = theme.MapEmbededThemeToEditorTheme(embededThemesJson) embededThemes = theme.MapEmbeddedThemeToEditorTheme(embededThemesJson)
} }
// Always have a default theme // Always have a default theme

View File

@ -2,6 +2,7 @@ package syntax
import ( import (
"fmt" "fmt"
"maps"
"strings" "strings"
"testing" "testing"
@ -361,9 +362,7 @@ func makeThemeWithCaptureOverrides(lineFg, keywordFg, stringFg lipgloss.Color) t
func cloneStyleMap(in map[string]lipgloss.Style) map[string]lipgloss.Style { func cloneStyleMap(in map[string]lipgloss.Style) map[string]lipgloss.Style {
out := make(map[string]lipgloss.Style, len(in)) out := make(map[string]lipgloss.Style, len(in))
for k, v := range in { maps.Copy(out, in)
out[k] = v
}
return out return out
} }

View File

@ -46,7 +46,7 @@ func LoadEmbeddedThemesJSON() (map[string]ThemeJSON, error) {
return out, nil return out, nil
} }
func MapEmbededThemeToEditorTheme(em map[string]ThemeJSON) map[string]EditorTheme { func MapEmbeddedThemeToEditorTheme(em map[string]ThemeJSON) map[string]EditorTheme {
out := make(map[string]EditorTheme, len(em)) out := make(map[string]EditorTheme, len(em))
for name, in := range em { for name, in := range em {
@ -111,12 +111,6 @@ func MapEmbededThemeToEditorTheme(em map[string]ThemeJSON) map[string]EditorThem
return out return out
} }
// MapEmbeddedThemeToEditorTheme is a correctly spelled alias for
// MapEmbededThemeToEditorTheme.
func MapEmbeddedThemeToEditorTheme(em map[string]ThemeJSON) map[string]EditorTheme {
return MapEmbededThemeToEditorTheme(em)
}
func styleFromJSON(in ColorStyleJSON) lipgloss.Style { func styleFromJSON(in ColorStyleJSON) lipgloss.Style {
out := lipgloss.NewStyle() out := lipgloss.NewStyle()

View File

@ -90,28 +90,6 @@ func TestMapEmbeddedThemeToEditorTheme_MapsStylesAndNormalizesSyntaxKeys(t *test
} }
} }
func TestMapEmbededThemeToEditorTheme_AliasMatchesPrimary(t *testing.T) {
in := map[string]ThemeJSON{
"x": {
Name: "x",
Line: ColorStyleJSON{FG: "#ffffff", BG: "#000000"},
Syntax: SyntaxJSON{
Group: map[string]string{"keyword": "#123456"},
},
},
}
a := MapEmbededThemeToEditorTheme(in)
b := MapEmbeddedThemeToEditorTheme(in)
if len(a) != len(b) {
t.Fatalf("alias map size mismatch: %d vs %d", len(a), len(b))
}
if colorHex(a["x"].Syntax.Group["keyword"].GetForeground()) != colorHex(b["x"].Syntax.Group["keyword"].GetForeground()) {
t.Fatalf("alias should produce identical mapped styles")
}
}
func colorHex(c any) string { func colorHex(c any) string {
return fmt.Sprint(c) return fmt.Sprint(c)
} }