diff options
| author | Kujtim Hoxha <[email protected]> | 2025-04-12 14:49:01 +0200 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-04-21 13:38:42 +0200 |
| commit | 0697dcc1d9c7330d8c9d8a2be0bb94b3d46c9345 (patch) | |
| tree | 9b45cabbb2c8f0195d8428445db4d8a710db7951 /internal/tui/components/chat/editor.go | |
| parent | 8d874b839db169906e18e4277cd198504018e022 (diff) | |
| download | opencode-0697dcc1d9c7330d8c9d8a2be0bb94b3d46c9345.tar.gz opencode-0697dcc1d9c7330d8c9d8a2be0bb94b3d46c9345.zip | |
implement nested tool calls and initial setup for result metadata
Diffstat (limited to 'internal/tui/components/chat/editor.go')
| -rw-r--r-- | internal/tui/components/chat/editor.go | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/internal/tui/components/chat/editor.go b/internal/tui/components/chat/editor.go index df336818c..e87f1ffae 100644 --- a/internal/tui/components/chat/editor.go +++ b/internal/tui/components/chat/editor.go @@ -77,21 +77,20 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { case AgentWorkingMsg: m.agentWorking = bool(msg) case tea.KeyMsg: - if key.Matches(msg, focusedKeyMaps.Send) { + // if the key does not match any binding, return + if m.textarea.Focused() && key.Matches(msg, focusedKeyMaps.Send) { return m, m.send() } - if key.Matches(msg, bluredKeyMaps.Send) { + if !m.textarea.Focused() && key.Matches(msg, bluredKeyMaps.Send) { return m, m.send() } - if key.Matches(msg, focusedKeyMaps.Blur) { + if m.textarea.Focused() && key.Matches(msg, focusedKeyMaps.Blur) { m.textarea.Blur() return m, util.CmdHandler(EditorFocusMsg(false)) } - if key.Matches(msg, bluredKeyMaps.Focus) { - if !m.textarea.Focused() { - m.textarea.Focus() - return m, tea.Batch(textarea.Blink, util.CmdHandler(EditorFocusMsg(true))) - } + if !m.textarea.Focused() && key.Matches(msg, bluredKeyMaps.Focus) { + m.textarea.Focus() + return m, tea.Batch(textarea.Blink, util.CmdHandler(EditorFocusMsg(true))) } } m.textarea, cmd = m.textarea.Update(msg) |
