Compare commits
No commits in common. "d270927ff7f7f8e41224661f7cd5b5a6bf39e13e" and "64c448c639b5e358e709cf185631b94df7b7736c" have entirely different histories.
d270927ff7
...
64c448c639
@ -1,6 +1,6 @@
|
||||
---
|
||||
description: Identifies dead code, unused dependencies, and structural bloat in Go projects
|
||||
mode: primary
|
||||
mode: subagent
|
||||
model: openai/gpt-5.4-mini
|
||||
temperature: 0.1
|
||||
permissions:
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
description: Reviews Go code for idiomatic patterns, performance, and concurrency safety
|
||||
mode: primary
|
||||
mode: subagent
|
||||
model: openai/gpt-5.4
|
||||
temperature: 0.1
|
||||
permission:
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
---
|
||||
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
|
||||
temperature: 0.1
|
||||
permission:
|
||||
|
||||
@ -51,6 +51,7 @@ type Model struct {
|
||||
registers map[rune]core.Register // name -> register
|
||||
|
||||
// Visual styles
|
||||
// currentTheme string // Name of current theme
|
||||
themes map[string]theme.EditorTheme
|
||||
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) {
|
||||
win := m.ActiveWindow()
|
||||
buf := m.ActiveBuffer()
|
||||
|
||||
@ -20,7 +20,7 @@ func NewModelBuilder() *ModelBuilder {
|
||||
var embededThemes map[string]theme.EditorTheme
|
||||
embededThemesJson, err := theme.LoadEmbeddedThemesJSON()
|
||||
if err == nil {
|
||||
embededThemes = theme.MapEmbeddedThemeToEditorTheme(embededThemesJson)
|
||||
embededThemes = theme.MapEmbededThemeToEditorTheme(embededThemesJson)
|
||||
}
|
||||
|
||||
// Always have a default theme
|
||||
|
||||
@ -2,7 +2,6 @@ package syntax
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@ -362,7 +361,9 @@ func makeThemeWithCaptureOverrides(lineFg, keywordFg, stringFg lipgloss.Color) t
|
||||
|
||||
func cloneStyleMap(in map[string]lipgloss.Style) map[string]lipgloss.Style {
|
||||
out := make(map[string]lipgloss.Style, len(in))
|
||||
maps.Copy(out, in)
|
||||
for k, v := range in {
|
||||
out[k] = v
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ func LoadEmbeddedThemesJSON() (map[string]ThemeJSON, error) {
|
||||
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))
|
||||
|
||||
for name, in := range em {
|
||||
@ -111,6 +111,12 @@ func MapEmbeddedThemeToEditorTheme(em map[string]ThemeJSON) map[string]EditorThe
|
||||
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 {
|
||||
out := lipgloss.NewStyle()
|
||||
|
||||
|
||||
@ -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 {
|
||||
return fmt.Sprint(c)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user