Skip to content

Commit

Permalink
fix: spacebar keybinding is now "space" instead of a literal space
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Sep 18, 2024
1 parent 3a53c6a commit f81fd52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 1 addition & 2 deletions table/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ func (km KeyMap) FullHelp() [][]key.Binding {

// DefaultKeyMap returns a default set of keybindings.
func DefaultKeyMap() KeyMap {
const spacebar = " "
return KeyMap{
LineUp: key.NewBinding(
key.WithKeys("up", "k"),
Expand All @@ -79,7 +78,7 @@ func DefaultKeyMap() KeyMap {
key.WithHelp("b/pgup", "page up"),
),
PageDown: key.NewBinding(
key.WithKeys("f", "pgdown", spacebar),
key.WithKeys("f", "pgdown", "space"),
key.WithHelp("f/pgdn", "page down"),
),
HalfPageUp: key.NewBinding(
Expand Down
4 changes: 1 addition & 3 deletions viewport/keymap.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package viewport

import "github.com/charmbracelet/bubbles/v2/key"

const spacebar = " "

// KeyMap defines the keybindings for the viewport. Note that you don't
// necessary need to use keybindings at all; the viewport can be controlled
// programmatically with methods like Model.LineDown(1). See the GoDocs for
Expand All @@ -21,7 +19,7 @@ type KeyMap struct {
func DefaultKeyMap() KeyMap {
return KeyMap{
PageDown: key.NewBinding(
key.WithKeys("pgdown", spacebar, "f"),
key.WithKeys("pgdown", "space", "f"),
key.WithHelp("f/pgdn", "page down"),
),
PageUp: key.NewBinding(
Expand Down

0 comments on commit f81fd52

Please sign in to comment.