fix: enable filepicker keymap only when selecting file.

This commit is contained in:
Maas Lalani 2023-06-22 10:48:30 -04:00
parent fe561c2c1e
commit b9cff0af13
No known key found for this signature in database
GPG key ID: 5A6ED5CBF1A0A000

View file

@ -70,6 +70,16 @@ func (m *Model) updateKeymap() {
m.keymap.Send.SetEnabled(m.canSend() && m.state == hoveringSendButton) m.keymap.Send.SetEnabled(m.canSend() && m.state == hoveringSendButton)
m.keymap.Unattach.SetEnabled(m.state == editingAttachments && len(m.Attachments.Items()) > 0) m.keymap.Unattach.SetEnabled(m.state == editingAttachments && len(m.Attachments.Items()) > 0)
m.keymap.Back.SetEnabled(m.state == pickingFile) 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 { func (m Model) canSend() bool {