fix: filepicker on empty directory

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2023-05-01 09:58:44 -04:00
committed by Maas Lalani
parent 9bfe8185f1
commit 7590e13c2a
+3
View File
@@ -423,6 +423,9 @@ func (m Model) DidSelectDisabledFile(msg tea.Msg) (bool, string) {
}
func (m Model) didSelectFile(msg tea.Msg) (bool, string) {
if len(m.files) == 0 {
return false, ""
}
switch msg := msg.(type) {
case tea.KeyMsg:
// If the msg does not match the Select keymap then this could not have been a selection.