summaryrefslogtreecommitdiff
path: root/internal/hexaiaction/tui.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-07 17:54:42 +0300
committerPaul Buetow <paul@buetow.org>2025-09-07 17:54:42 +0300
commit77e41a1018715fa5ac4e6156354710b3b224b4fc (patch)
tree23d847008c34a4c8b1329151fd33ac107fdefe76 /internal/hexaiaction/tui.go
parenta240e1e106d3b8028bbb3667b44cf3085875e405 (diff)
feat: add Custom prompt action (p) with editor integration; shared editor helper in internal/editor; hexai CLI opens editor when no args
Diffstat (limited to 'internal/hexaiaction/tui.go')
-rw-r--r--internal/hexaiaction/tui.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/hexaiaction/tui.go b/internal/hexaiaction/tui.go
index 80b1fee..317a991 100644
--- a/internal/hexaiaction/tui.go
+++ b/internal/hexaiaction/tui.go
@@ -31,6 +31,7 @@ func newModel() model {
item{title: "Simplify and improve", desc: "", kind: ActionSimplify, hotkey: 'i'},
item{title: "Document code", desc: "", kind: ActionDocument, hotkey: 'c'},
item{title: "Generate Go unit test(s)", desc: "", kind: ActionGoTest, hotkey: 't'},
+ item{title: "Custom prompt", desc: "", kind: ActionCustom, hotkey: 'p'},
item{title: "Skip", desc: "", kind: ActionSkip, hotkey: 's'},
}
l := list.New(items, oneLineDelegate{}, 0, 0)
@@ -78,7 +79,7 @@ func handleKey(m model, msg tea.KeyMsg) (tea.Model, tea.Cmd) {
m.list.Select(0)
case "end":
if n := len(m.list.Items()); n > 0 { m.list.Select(n - 1) }
- case "s", "r", "c", "t", "i":
+ case "s", "r", "c", "t", "i", "p":
items := m.list.Items()
for i := 0; i < len(items); i++ {
if it, ok := items[i].(item); ok && strings.ToLower(string(it.hotkey)) == low {