Skip to content

Commit 9ffcdc0

Browse files
authored
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
1 parent 9d9d5ad commit 9ffcdc0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

table/table.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ type KeyMap struct {
4747
GotoBottom key.Binding
4848
}
4949

50+
// ShortHelp implements the KeyMap interface.
51+
func (km KeyMap) ShortHelp() []key.Binding {
52+
return []key.Binding{km.LineUp, km.LineDown}
53+
}
54+
55+
// FullHelp implements the KeyMap interface.
56+
func (km KeyMap) FullHelp() [][]key.Binding {
57+
return [][]key.Binding{
58+
{km.LineUp, km.LineDown, km.GotoTop, km.GotoBottom},
59+
{km.PageUp, km.PageDown, km.HalfPageUp, km.HalfPageDown},
60+
}
61+
}
62+
5063
// DefaultKeyMap returns a default set of keybindings.
5164
func DefaultKeyMap() KeyMap {
5265
const spacebar = " "

0 commit comments

Comments
 (0)