diff --git a/internal/tui/components/chat/editor/editor.go b/internal/tui/components/chat/editor/editor.go index b7e106a920490b66b9ef7910d60683dc75710ab0..58c2ba84f26f1ea911c7596479b1dcf358793a64 100644 --- a/internal/tui/components/chat/editor/editor.go +++ b/internal/tui/components/chat/editor/editor.go @@ -321,7 +321,7 @@ func (m *editorCmp) Update(msg tea.Msg) (util.Model, tea.Cmd) { } // if any key other than history related controls we play it safe and close // the history and reset the text input field to be the current value - if !key.Matches(msg, m.keyMap.Previous) && !key.Matches(msg, m.keyMap.Next) { + if !key.Matches(msg, m.keyMap.Previous) && !key.Matches(msg, m.keyMap.Next) && msg.Key().String() != "left" && msg.Key().String() != "right" { cmds = append(cmds, util.CmdHandler(CloseHistoryMsg{ valueToSet: m.textarea.Value(), })) @@ -478,7 +478,7 @@ func (m *editorCmp) handleNextKeypressSideEffect() []tea.Cmd { if m.textarea.Line() == m.textarea.LineCount()-1 { // NOTE(tauraamui): if lineInfo.RowOffset == lineInfo.Height-1 { - if lineInfo.ColumnOffset == lineInfo.Width { + if lineInfo.ColumnOffset == lineInfo.Width-1 { if !m.inHistoryMode() { cmds = append(cmds, util.CmdHandler(LoadHistoryMsg{})) }