The open source coding agent.
TypeScript
small changes
Kujtim Hoxha6d05d5a7c3bf
diff --git a/internal/tui/components/chat/editor.go b/internal/tui/components/chat/editor.goindex 2d89803cd79..bb431053a87 100644--- a/internal/tui/components/chat/editor.go+++ b/internal/tui/components/chat/editor.go@@ -21,9 +21,7 @@ type editorCmp struct {textarea textarea.Model}-type FocusEditorMsg bool--type focusedEditorKeyMaps struct {+type EditorKeyMaps struct {Send key.BindingOpenEditor key.Binding}@@ -34,10 +32,10 @@ type bluredEditorKeyMaps struct {OpenEditor key.Binding}-var KeyMaps = focusedEditorKeyMaps{+var editorMaps = EditorKeyMaps{Send: key.NewBinding(- key.WithKeys("ctrl+s"),- key.WithHelp("ctrl+s", "send message"),+ key.WithKeys("enter", "ctrl+s"),+ key.WithHelp("enter", "send message"),),OpenEditor: key.NewBinding(key.WithKeys("ctrl+e"),@@ -107,29 +105,24 @@ 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, messageKeys.PageUp) || key.Matches(msg, messageKeys.PageDown) ||key.Matches(msg, messageKeys.HalfPageUp) || key.Matches(msg, messageKeys.HalfPageDown) {return m, nil}- if key.Matches(msg, KeyMaps.OpenEditor) {+ if key.Matches(msg, editorMaps.OpenEditor) {if m.app.CoderAgent.IsSessionBusy(m.session.ID) {return m, util.ReportWarn("Agent is working, please wait...")}return m, openEditor()}// if the key does not match any binding, return- if m.textarea.Focused() && key.Matches(msg, KeyMaps.Send) {+ if m.textarea.Focused() && key.Matches(msg, editorMaps.Send) {return m, m.send()}-+// Handle Enter key- if m.textarea.Focused() && msg.String() == "enter" {+ if m.textarea.Focused() && key.Matches(msg, editorMaps.Send) {value := m.textarea.Value()if len(value) > 0 && value[len(value)-1] == '\\' {// If the last character is a backslash, remove it and add a newline@@ -163,7 +156,7 @@ func (m *editorCmp) GetSize() (int, int) {func (m *editorCmp) BindingKeys() []key.Binding {bindings := []key.Binding{}- bindings = append(bindings, layout.KeyMapToSlice(KeyMaps)...)+ bindings = append(bindings, layout.KeyMapToSlice(editorMaps)...)return bindings}diff --git a/internal/tui/components/chat/message.go b/internal/tui/components/chat/message.goindex b8e45007978..bc6c19e40bb 100644--- a/internal/tui/components/chat/message.go+++ b/internal/tui/components/chat/message.go@@ -28,7 +28,7 @@ const (assistantMessageTypetoolMessageType- maxResultHeight = 15+ maxResultHeight = 10)var diffStyle = diff.NewStyleConfig(diff.WithShowHeader(false), diff.WithShowHunkHeader(false))@@ -148,7 +148,7 @@ func renderAssistantMessage(content = "*Finished without output*"}- content = renderMessage(content, false, msg.ID == focusedUIMessageId, width, info...)+ content = renderMessage(content, false, true, width, info...)messages = append(messages, uiMessage{ID: msg.ID,messageType: assistantMessageType,diff --git a/internal/tui/tui.go b/internal/tui/tui.goindex 9744c4cf2a4..213700d6c81 100644--- a/internal/tui/tui.go+++ b/internal/tui/tui.go@@ -224,7 +224,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {a.app.Permissions.GrantPersistant(msg.Permission)case dialog.PermissionDeny:a.app.Permissions.Deny(msg.Permission)- cmd = util.CmdHandler(chat.FocusEditorMsg(true))}a.showPermissions = falsereturn a, cmd