Compare commits
2 Commits
64c448c639
...
d270927ff7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d270927ff7 | ||
|
|
e27c7560a2 |
@ -1,6 +1,6 @@
|
||||
---
|
||||
description: Identifies dead code, unused dependencies, and structural bloat in Go projects
|
||||
mode: subagent
|
||||
mode: primary
|
||||
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: subagent
|
||||
mode: primary
|
||||
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: subagent
|
||||
mode: primary
|
||||
model: openai/gpt-5.3-codex
|
||||
temperature: 0.1
|
||||
permission:
|
||||
|
||||
@ -51,7 +51,6 @@ 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
|
||||
|
||||
@ -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) {
|
||||
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.MapEmbededThemeToEditorTheme(embededThemesJson)
|
||||
embededThemes = theme.MapEmbeddedThemeToEditorTheme(embededThemesJson)
|
||||
}
|
||||
|
||||
// Always have a default theme
|
||||
|
||||
@ -2,6 +2,7 @@ package syntax
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"maps"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@ -361,9 +362,7 @@ 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))
|
||||
for k, v := range in {
|
||||
out[k] = v
|
||||
}
|
||||
maps.Copy(out, in)
|
||||
return out
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ func LoadEmbeddedThemesJSON() (map[string]ThemeJSON, error) {
|
||||
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))
|
||||
|
||||
for name, in := range em {
|
||||
@ -111,12 +111,6 @@ func MapEmbededThemeToEditorTheme(em map[string]ThemeJSON) map[string]EditorThem
|
||||
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,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 {
|
||||
return fmt.Sprint(c)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user