Fix keybinding examples

This commit is contained in:
Christian Rocha 2021-09-01 11:31:14 -04:00
parent d987ef84f2
commit 500d7989e1
2 changed files with 8 additions and 8 deletions

View File

@ -117,13 +117,13 @@ type KeyMap struct {
var DefaultKeyMap = KeyMap{
Up: key.NewBinding(
key.WithKeys("k", "up"),
key.WithHelp("↑/k", "move up"),
key.WithKeys("k", "up"), // actual keybindings
key.WithHelp("↑/k", "move up"), // corresponding help text
),
Down: key.Binding{
Down: key.NewBinding(
WithKeys("j", "down"),
WithHelp("↓/j", "move down"),
},
),
}
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {

View File

@ -9,13 +9,13 @@
//
// var DefaultKeyMap = KeyMap{
// Up: key.NewBinding(
// key.WithKeys("k", "up"),
// key.WithHelp("↑/k", "move up"),
// key.WithKeys("k", "up"), // actual keybindings
// key.WithHelp("↑/k", "move up"), // corresponding help text
// ),
// Down: key.Binding{
// Down: key.NewBinding(
// WithKeys("j", "down"),
// WithHelp("↓/j", "move down"),
// },
// ),
// }
//
// func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {