Skip to content
Myr

feat: obliterate type KeySpace

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

Treating a space differently from other runes was proving to cause more confusion that clarity.

authored by Christian Rocha · committed by Christian Rocha · parent 48cdc1e · Browse files · 1 file+0 added−10 removed
This commit

State

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

Diff stats

1 file+0 added−10 removed

  • other:+0 added−10 removed

1 file+0 added−10 removed

modified:key.go-10 removed
196 unmodified lines
197 KeyEnd198 KeyPgUp199 KeyPgDown200 KeyDelete201 KeySpace201 KeyCtrlUp202 KeyCtrlDown203 KeyCtrlRight204 KeyCtrlLeft
68 unmodified lines
273 KeyRunes: "runes",274 KeyUp: "up",275 KeyDown: "down",276 KeyRight: "right",278 KeySpace: " ", // for backwards compatibility277 KeyLeft: "left",278 KeyShiftTab: "shift+tab",279 KeyHome: "home",280 KeyEnd: "end",
270 unmodified lines
551 KeyMsg(Key{Type: r}),552 }, nil553 }554557 // If it's a space, override the type with KeySpace (but still include the558 // rune).559 if runes[0] == ' ' {560 return []Msg{561 KeyMsg(Key{Type: KeySpace, Runes: runes}),562 }, nil563 }564555 // Welp, it's just a regular, ol' single rune.556 return []Msg{557 KeyMsg(Key{Type: KeyRunes, Runes: runes}),558 }, nil
1 unmodified line