Skip to content
Myr

Don't treat the space character as a control character

Before adoption: this commit came in with the history the project adopted, so no landing records it.

There are drawbacks to both sides of this, but in the end, it seems to make more sense to treat spaces as regular runes.

authored by Christian Rocha · committed by Christian Rocha · parent dafb022 · Browse files · 2 files+1 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+1 added−7 removed

  • other:+1 added−7 removed

2 files+1 added−7 removed

modified:viewport/viewport.go+1 added-1 removed
84 unmodified lines
8586 // Down one page87 case "pgdown":88 fallthrough89 case "space":89 case " ": // spacebar90 fallthrough91 case "f":92 m.ViewDown()93 return m, nil
78 unmodified lines
modified:key.go-6 removed
254 unmodified lines
255 if numBytes == 1 && char <= keyUS || char == keyDEL {256 return Key{Type: KeyType(char)}, nil257 }258259 // If it's a space treat it like a control character (otherwise it gets260 // treated as the character " "261 if string(char) == " " {262 return Key{Type: KeyType(keySP)}, nil263 }264259 // Is it a special sequence, like an arrow key?260 if k, ok := sequences[string(buf[:numBytes])]; ok {261 return Key{Type: k}, nil262 }
16 unmodified lines