From 500d7989e184baeb3b76ac044f83fa7fd32a75c7 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 1 Sep 2021 11:31:14 -0400 Subject: [PATCH] Fix keybinding examples --- README.md | 8 ++++---- key/key.go | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8c5e1e3b..0cae9158 100644 --- a/README.md +++ b/README.md @@ -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) { diff --git a/key/key.go b/key/key.go index 3ca02c03..4c2ba9a6 100644 --- a/key/key.go +++ b/key/key.go @@ -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) {