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:
Christian Rocha
2020-05-19 14:41:55 -04:00
parent dafb022fe5
commit ee5f82579f
2 changed files with 1 additions and 7 deletions

6
key.go
View File

@@ -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

View File

@@ -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()