xonecas.io
62159
Sy

symb / commit 2492a25

fix: agent input now feels better and defaults to markdown syntax hl

xonecas2026-02-14 2492a25ce5095c55390cf30e6835df5ca5a43ec6 parent e56f387

7 files changed

Makefile+1−1
@@ -10,7 +10,7 @@ run:
1010
1111 # Run tests
1212 test:
13- go test -v -race -coverprofile=coverage.out ./...
13+ go test -v -race -coverprofile=coverage.out ./cmd/... ./internal/...
1414
1515 # Run linter
1616 lint:
internal/constants/constants.go+1−1
@@ -57,4 +57,4 @@ package constants
5757 // - fruity, autumn, friendly, colorful, tango, algol, arduino
5858 // - base16-snazzy, borland, emacs, pygments, rainbow_dash
5959 // - and more...
60-const SyntaxTheme = "modus-vivendi"
60+const SyntaxTheme = "modus-vivendi"
internal/tui/editor/editor.go+1−0
@@ -31,6 +31,7 @@ type Model struct {
3131 // Public configuration — set before first Update/View.
3232 ReadOnly bool
3333 ShowLineNumbers bool
34+ SubmitOnEnter bool // Enter is a no-op (parent handles submit); shift+enter inserts newline
3435 Language string // Chroma lexer name (empty = no highlighting)
3536 SyntaxTheme string // Chroma style name (empty = no highlighting)
3637 Placeholder string // Shown when empty and blurred
internal/tui/editor/update.go+10−0
@@ -181,7 +181,17 @@ func (m *Model) handleEditKey(key string) bool {
181181 } else {
182182 m.deleteForward()
183183 }
184+ case "shift+enter":
185+ if m.SubmitOnEnter {
186+ m.DeleteSelection()
187+ m.insertNewline()
188+ } else {
189+ return false
190+ }
184191 case "enter":
192+ if m.SubmitOnEnter {
193+ return false // Let parent handle submit
194+ }
185195 m.DeleteSelection()
186196 m.insertNewline()
187197 case "tab":
internal/tui/testdata/TestLayout/120x40/ANSI.golden+1−1
@@ -37,4 +37,4 @@
3737  │  
3838  │  
3939 ────────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────
40- symb ⣾  
40+ symb ⣾  
internal/tui/testdata/TestLayout/80x24/ANSI.golden+1−1
@@ -21,4 +21,4 @@
2121  │  
2222  │  
2323 ────────────────────────────────────────┴───────────────────────────────────────
24- symb ⣾  
24+ symb ⣾  
internal/tui/tui.go+3−0
@@ -231,6 +231,9 @@ func New(prov provider.Provider, proxy *mcp.Proxy, tools []mcp.Tool, modelID str
231231
232232 ai := editor.New()
233233 ai.Placeholder = "Type a message..."
234+ ai.SubmitOnEnter = true
235+ ai.Language = "markdown"
236+ ai.SyntaxTheme = constants.SyntaxTheme
234237 ai.CursorStyle = cursorStyle
235238 ai.SelectionStyle = selStyle
236239 ai.PlaceholderSty = lipgloss.NewStyle().Foreground(ColorDim).Background(ColorBg)