From b9cff0af13accd4df595f1d21fa73856e6818218 Mon Sep 17 00:00:00 2001 From: Maas Lalani Date: Thu, 22 Jun 2023 10:48:30 -0400 Subject: [PATCH] fix: enable filepicker keymap only when selecting file. --- keymap.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/keymap.go b/keymap.go index 1642ad1..948348e 100644 --- a/keymap.go +++ b/keymap.go @@ -70,6 +70,16 @@ func (m *Model) updateKeymap() { m.keymap.Send.SetEnabled(m.canSend() && m.state == hoveringSendButton) m.keymap.Unattach.SetEnabled(m.state == editingAttachments && len(m.Attachments.Items()) > 0) m.keymap.Back.SetEnabled(m.state == pickingFile) + + m.filepicker.KeyMap.Up.SetEnabled(m.state == pickingFile) + m.filepicker.KeyMap.Down.SetEnabled(m.state == pickingFile) + m.filepicker.KeyMap.Back.SetEnabled(m.state == pickingFile) + m.filepicker.KeyMap.Select.SetEnabled(m.state == pickingFile) + m.filepicker.KeyMap.Open.SetEnabled(m.state == pickingFile) + m.filepicker.KeyMap.PageUp.SetEnabled(m.state == pickingFile) + m.filepicker.KeyMap.PageDown.SetEnabled(m.state == pickingFile) + m.filepicker.KeyMap.GoToTop.SetEnabled(m.state == pickingFile) + m.filepicker.KeyMap.GoToLast.SetEnabled(m.state == pickingFile) } func (m Model) canSend() bool {