List that space can be bound through Char(' ') (#486)

Necessary to complete nushell/nushell#6590

(Comment: this whole module feels intricately linked to the nushell
implementation as we do not implement the string parsing in reedline)
This commit is contained in:
Stefan Holderbach 2022-09-20 12:19:03 +02:00 committed by GitHub
parent 9a6fdd78dc
commit 710393a037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@ use strum::IntoEnumIterator;
struct ReedLineCrossTermKeyCode(crossterm::event::KeyCode);
impl ReedLineCrossTermKeyCode {
fn iterator() -> std::slice::Iter<'static, ReedLineCrossTermKeyCode> {
static KEYCODE: [ReedLineCrossTermKeyCode; 18] = [
static KEYCODE: [ReedLineCrossTermKeyCode; 19] = [
ReedLineCrossTermKeyCode(KeyCode::Backspace),
ReedLineCrossTermKeyCode(KeyCode::Enter),
ReedLineCrossTermKeyCode(KeyCode::Left),
@ -25,6 +25,7 @@ impl ReedLineCrossTermKeyCode {
ReedLineCrossTermKeyCode(KeyCode::Delete),
ReedLineCrossTermKeyCode(KeyCode::Insert),
ReedLineCrossTermKeyCode(KeyCode::F(1)),
ReedLineCrossTermKeyCode(KeyCode::Char(' ')),
ReedLineCrossTermKeyCode(KeyCode::Char('a')),
ReedLineCrossTermKeyCode(KeyCode::Null),
ReedLineCrossTermKeyCode(KeyCode::Esc),
@ -52,6 +53,7 @@ impl Display for ReedLineCrossTermKeyCode {
KeyCode::Delete => write!(f, "Delete"),
KeyCode::Insert => write!(f, "Insert"),
KeyCode::F(_) => write!(f, "F<number>"),
KeyCode::Char(' ') => write!(f, "Space"),
KeyCode::Char(_) => write!(f, "Char_<letter>"),
KeyCode::Null => write!(f, "Null"),
KeyCode::Esc => write!(f, "Esc"),