Skip to content

Commit f7b03f4

Browse files
committed
feat(binds): Better binds
Signed-off-by: dark0dave <dark0dave@mykolab.com>
1 parent 93cd2f2 commit f7b03f4

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cmd/directory-picker.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
)
1414

1515
var (
16-
helpStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("241"))
16+
helpStyle = lipgloss.NewStyle().Padding(1, 0, 0, 2).Foreground(lipgloss.Color("241"))
1717
)
1818

1919
type directoryPicker struct {
@@ -25,13 +25,15 @@ type directoryPicker struct {
2525
err error
2626
}
2727

28+
// TODO: Hide unselectable
2829
func NewDirectoryPicker(dir bool, message string, nextCommand func(string) (tea.Model, tea.Cmd)) directoryPicker {
2930
fp := filepicker.New()
3031
fp.DirAllowed = dir
3132
fp.FileAllowed = !dir
3233
h, _ := docStyle.GetFrameSize()
3334
fp.Height = height - h - 5
3435
fp.AutoHeight = true
36+
fp.ShowHidden = false
3537
fp.CurrentDirectory = currentDirectory
3638
return directoryPicker{
3739
filepicker: fp,
@@ -63,7 +65,7 @@ func (d directoryPicker) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
6365
if d.selectedFile != "" {
6466
return d.nextCommand(d.selectedFile)
6567
}
66-
case "ctrl+c", "q":
68+
case "ctrl+c", "q", "esc":
6769
d.quitting = true
6870
return d, tea.Quit
6971
}
@@ -106,6 +108,6 @@ func (d directoryPicker) View() string {
106108
}
107109

108110
s.WriteString("\n\n" + d.filepicker.View() + "\n")
109-
s.WriteString(helpStyle.Render(" Keys: e->done, escape->./.., q->quit"))
111+
s.WriteString(helpStyle.Render("e done • <-/-> move • q quit"))
110112
return s.String()
111113
}

0 commit comments

Comments
 (0)