Compare commits

..

No commits in common. "d270927ff7f7f8e41224661f7cd5b5a6bf39e13e" and "64c448c639b5e358e709cf185631b94df7b7736c" have entirely different histories.

8 changed files with 38 additions and 8 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: primary mode: subagent
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: primary mode: subagent
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: primary mode: subagent
model: openai/gpt-5.3-codex model: openai/gpt-5.3-codex
temperature: 0.1 temperature: 0.1
permission: permission:

View File

@ -51,6 +51,7 @@ 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
@ -185,7 +186,7 @@ func (m *Model) replayInsert() {
} }
} }
// TODO: This can't be the best way.... // TODO: Fix this shitty shit shit shit
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.MapEmbeddedThemeToEditorTheme(embededThemesJson) embededThemes = theme.MapEmbededThemeToEditorTheme(embededThemesJson)
} }
// Always have a default theme // Always have a default theme

View File

@ -2,7 +2,6 @@ package syntax
import ( import (
"fmt" "fmt"
"maps"
"strings" "strings"
"testing" "testing"
@ -362,7 +361,9 @@ 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))
maps.Copy(out, in) for k, v := range 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 MapEmbeddedThemeToEditorTheme(em map[string]ThemeJSON) map[string]EditorTheme { func MapEmbededThemeToEditorTheme(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,6 +111,12 @@ func MapEmbeddedThemeToEditorTheme(em map[string]ThemeJSON) map[string]EditorThe
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,6 +90,28 @@ 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)
} }