From 6e854a4df4e4933d478e5eb1d48ccb34db610194 Mon Sep 17 00:00:00 2001 From: Ed Zynda Date: Mon, 19 May 2025 02:41:34 +0300 Subject: fix: disable history navigation when filepicker is open (#39) --- internal/tui/components/chat/editor.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'internal/tui/components') diff --git a/internal/tui/components/chat/editor.go b/internal/tui/components/chat/editor.go index dbaa05181..212ad5529 100644 --- a/internal/tui/components/chat/editor.go +++ b/internal/tui/components/chat/editor.go @@ -247,7 +247,8 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } // Handle history navigation with up/down arrow keys - if m.textarea.Focused() && key.Matches(msg, editorMaps.HistoryUp) { + // Only handle history navigation if the filepicker is not open + if m.textarea.Focused() && key.Matches(msg, editorMaps.HistoryUp) && !m.app.IsFilepickerOpen() { // Get the current line number currentLine := m.textarea.Line() @@ -267,7 +268,7 @@ func (m *editorCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } } - if m.textarea.Focused() && key.Matches(msg, editorMaps.HistoryDown) { + if m.textarea.Focused() && key.Matches(msg, editorMaps.HistoryDown) && !m.app.IsFilepickerOpen() { // Get the current line number and total lines currentLine := m.textarea.Line() value := m.textarea.Value() -- cgit v1.2.3