fix: spacebar keybinding is now "space" instead of a literal space

This commit is contained in:
Ayman Bagabas
2024-09-18 14:55:49 -04:00
parent 3a53c6a995
commit f81fd5246a
2 changed files with 2 additions and 5 deletions
+1 -2
View File
@@ -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"),
@@ -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(
+1 -3
View File
@@ -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
@@ -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(