Skip to content

Commit

Permalink
add HelpKeyBinds method to new field FilePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
ardnew committed Apr 9, 2024
1 parent 2487303 commit 2386a6c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion field_filepicker.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,16 @@ func (f *FilePicker) Blur() tea.Cmd {
return nil
}

// KeyBinds returns the help keybindings for the file field.
// KeyBinds returns all keybindings for the file field.
func (f *FilePicker) KeyBinds() []key.Binding {
return []key.Binding{f.keymap.Up, f.keymap.Down, f.keymap.Close, f.keymap.Open, f.keymap.Prev, f.keymap.Next, f.keymap.Submit}
}

// HelpKeyBinds returns the help keybindings for the file field.
func (f *FilePicker) HelpKeyBinds(HelpFormat) []key.Binding {
return f.KeyBinds()
}

// Init initializes the file field.
func (f *FilePicker) Init() tea.Cmd {
return f.picker.Init()
Expand Down

0 comments on commit 2386a6c

Please sign in to comment.