summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/components/chat/editor.go
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-18 21:24:35 +0200
committerKujtim Hoxha <[email protected]>2025-04-21 13:42:29 +0200
commit72afeb9f54cee8e248093a52ac0779441c79aea3 (patch)
tree70f5966bcf2cb8a6186780ea5b22a3515bc8ee22 /internal/tui/components/chat/editor.go
parent333ea6ec4b2abfc2c1a9c3f6b0918ca5d296347f (diff)
downloadopencode-72afeb9f54cee8e248093a52ac0779441c79aea3.tar.gz
opencode-72afeb9f54cee8e248093a52ac0779441c79aea3.zip
small fixes
Diffstat (limited to 'internal/tui/components/chat/editor.go')
-rw-r--r--internal/tui/components/chat/editor.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/internal/tui/components/chat/editor.go b/internal/tui/components/chat/editor.go
index 537ef392c..963fbbdbf 100644
--- a/internal/tui/components/chat/editor.go
+++ b/internal/tui/components/chat/editor.go
@@ -21,6 +21,8 @@ type editorCmp struct {
textarea textarea.Model
}
+type FocusEditorMsg bool
+
type focusedEditorKeyMaps struct {
Send key.Binding
OpenEditor key.Binding
@@ -112,7 +114,6 @@ func (m *editorCmp) send() tea.Cmd {
util.CmdHandler(SendMsg{
Text: value,
}),
- util.CmdHandler(EditorFocusMsg(false)),
)
}
@@ -124,9 +125,13 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.session = msg
}
return m, nil
+ case FocusEditorMsg:
+ if msg {
+ m.textarea.Focus()
+ return m, tea.Batch(textarea.Blink, util.CmdHandler(EditorFocusMsg(true)))
+ }
case tea.KeyMsg:
if key.Matches(msg, focusedKeyMaps.OpenEditor) {
- m.textarea.Blur()
return m, openEditor()
}
// if the key does not match any binding, return