Skip to content

Commit

Permalink
Fix keybinding examples
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Sep 1, 2021
1 parent d987ef8 commit 500d798
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions key/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 500d798

Please sign in to comment.