mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
feat(table): implement help.Keymap interface and add quit mapping (#440)
* feat(table): implement help.Keymap interface and add quit mapping * feat(table): implement help.Keymap interface and add quit mapping
This commit is contained in:
@@ -47,6 +47,19 @@ type KeyMap struct {
|
|||||||
GotoBottom key.Binding
|
GotoBottom key.Binding
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ShortHelp implements the KeyMap interface.
|
||||||
|
func (km KeyMap) ShortHelp() []key.Binding {
|
||||||
|
return []key.Binding{km.LineUp, km.LineDown}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FullHelp implements the KeyMap interface.
|
||||||
|
func (km KeyMap) FullHelp() [][]key.Binding {
|
||||||
|
return [][]key.Binding{
|
||||||
|
{km.LineUp, km.LineDown, km.GotoTop, km.GotoBottom},
|
||||||
|
{km.PageUp, km.PageDown, km.HalfPageUp, km.HalfPageDown},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DefaultKeyMap returns a default set of keybindings.
|
// DefaultKeyMap returns a default set of keybindings.
|
||||||
func DefaultKeyMap() KeyMap {
|
func DefaultKeyMap() KeyMap {
|
||||||
const spacebar = " "
|
const spacebar = " "
|
||||||
|
|||||||
Reference in New Issue
Block a user