From 624179a7931ae82cae2aa623213a647b3e5cff17 Mon Sep 17 00:00:00 2001 From: tauraamui Date: Wed, 15 Oct 2025 16:23:21 +0100 Subject: [PATCH] fix: add existing text area content to history for first time --- internal/tui/components/chat/editor/editor.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/tui/components/chat/editor/editor.go b/internal/tui/components/chat/editor/editor.go index 0ee9fc94b4915ecb0ca6732cf8c8b9431c5e0ca3..69434773b184b65d6fdfb3caa11c2b29646e9030 100644 --- a/internal/tui/components/chat/editor/editor.go +++ b/internal/tui/components/chat/editor/editor.go @@ -622,6 +622,8 @@ func (m *editorCmp) getUserMessagesAsText(ctx context.Context) ([]string, error) userMessages = append(userMessages, msg.Content().Text) } } + + userMessages = append(userMessages, m.textarea.Value()) return userMessages, nil } @@ -680,9 +682,6 @@ func (m *editorCmp) stepBack(history []string) string { func (m *editorCmp) stepForward(history []string) string { m.promptHistoryIndex += 1 maxIndex := len(history) - 1 - if m.scrollingPromptHistory { - maxIndex = len(history) - 2 - } if m.promptHistoryIndex > maxIndex { m.promptHistoryIndex = maxIndex }