mirror of
https://github.com/taigrr/bubbletea.git
synced 2026-04-02 02:59:09 -07:00
Don't treat the space character as a control character
There are drawbacks to both sides of this, but in the end, it seems to make more sense to treat spaces as regular runes.
This commit is contained in:
6
key.go
6
key.go
@@ -256,12 +256,6 @@ func ReadKey(r io.Reader) (Key, error) {
|
||||
return Key{Type: KeyType(char)}, nil
|
||||
}
|
||||
|
||||
// If it's a space treat it like a control character (otherwise it gets
|
||||
// treated as the character " "
|
||||
if string(char) == " " {
|
||||
return Key{Type: KeyType(keySP)}, nil
|
||||
}
|
||||
|
||||
// Is it a special sequence, like an arrow key?
|
||||
if k, ok := sequences[string(buf[:numBytes])]; ok {
|
||||
return Key{Type: k}, nil
|
||||
|
||||
@@ -86,7 +86,7 @@ func Update(msg boba.Msg, m Model) (Model, boba.Cmd) {
|
||||
// Down one page
|
||||
case "pgdown":
|
||||
fallthrough
|
||||
case "space":
|
||||
case " ": // spacebar
|
||||
fallthrough
|
||||
case "f":
|
||||
m.ViewDown()
|
||||
|
||||
Reference in New Issue
Block a user