From 9aed95408d03b74b4ff5aff61d1c99e8b7acceef Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Tue, 20 Sep 2022 13:04:35 +0200 Subject: [PATCH] Add "space" key to bind in vi normal mode (#6590) * Add "space" key to bind in vi normal mode Implements #6586 No special logic to prevent you from binding it in other modes! Needs a separate change to reedline to make it available in the default listing of `keybindings list`. * Update reedline to report the available `space` Pulls in nushell/reedline#486 --- Cargo.lock | 2 +- Cargo.toml | 7 +++---- crates/nu-cli/Cargo.toml | 3 +-- crates/nu-cli/src/reedline_config.rs | 1 + crates/nu-command/Cargo.toml | 3 +-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b48c322e8e..67d86d87af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4079,7 +4079,7 @@ dependencies = [ [[package]] name = "reedline" version = "0.11.0" -source = "git+http://github.com/nushell/reedline?rev=9a6fdd7#9a6fdd78dcf2fc472040748b5c9dc0b0f0ee31f6" +source = "git+https://github.com/nushell/reedline?branch=main#710393a0375860709e368d0ba8c5883a6e44e673" dependencies = [ "chrono", "crossterm 0.24.0", diff --git a/Cargo.toml b/Cargo.toml index 7b31634067..34eac2a169 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,8 +53,7 @@ nu-system = { path = "./crates/nu-system", version = "0.68.2" } nu-table = { path = "./crates/nu-table", version = "0.68.2" } nu-term-grid = { path = "./crates/nu-term-grid", version = "0.68.2" } nu-utils = { path = "./crates/nu-utils", version = "0.68.2" } -# reedline = { version = "0.11.0", features = ["bashisms", "sqlite"]} -reedline = { git = "http://github.com/nushell/reedline", rev = "9a6fdd7", features = ["bashisms", "sqlite"]} +reedline = { version = "0.11.0", features = ["bashisms", "sqlite"]} rayon = "1.5.1" is_executable = "1.0.1" @@ -124,5 +123,5 @@ debug = false name = "nu" path = "src/main.rs" -# [patch.crates-io] -# reedline = { git = "https://github.com/nushell/reedline", branch = "main" } +[patch.crates-io] +reedline = { git = "https://github.com/nushell/reedline", branch = "main" } diff --git a/crates/nu-cli/Cargo.toml b/crates/nu-cli/Cargo.toml index 39680f2dbd..cb2f44ab16 100644 --- a/crates/nu-cli/Cargo.toml +++ b/crates/nu-cli/Cargo.toml @@ -20,8 +20,7 @@ nu-protocol = { path = "../nu-protocol", version = "0.68.2" } nu-utils = { path = "../nu-utils", version = "0.68.2" } nu-ansi-term = "0.46.0" nu-color-config = { path = "../nu-color-config", version = "0.68.2" } -# reedline = { version = "0.11.0", features = ["bashisms", "sqlite"]} -reedline = { git = "http://github.com/nushell/reedline", rev = "9a6fdd7", features = ["bashisms", "sqlite"]} +reedline = { version = "0.11.0", features = ["bashisms", "sqlite"]} atty = "0.2.14" chrono = "0.4.21" diff --git a/crates/nu-cli/src/reedline_config.rs b/crates/nu-cli/src/reedline_config.rs index dfc13e4eb1..d2dba8be2b 100644 --- a/crates/nu-cli/src/reedline_config.rs +++ b/crates/nu-cli/src/reedline_config.rs @@ -666,6 +666,7 @@ fn add_parsed_keybinding( KeyCode::Char(char) } + "space" => KeyCode::Char(' '), "down" => KeyCode::Down, "up" => KeyCode::Up, "left" => KeyCode::Left, diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index db4b814606..29a63c44ef 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -87,8 +87,7 @@ unicode-segmentation = "1.8.0" url = "2.2.1" uuid = { version = "1.1.2", features = ["v4"] } which = { version = "4.3.0", optional = true } -# reedline = { version = "0.11.0", features = ["bashisms", "sqlite"]} -reedline = { git = "http://github.com/nushell/reedline", rev = "9a6fdd7", features = ["bashisms", "sqlite"]} +reedline = { version = "0.11.0", features = ["bashisms", "sqlite"]} wax = { version = "0.5.0", features = ["diagnostics"] } rusqlite = { version = "0.28.0", features = ["bundled"], optional = true } sqlparser = { version = "0.23.0", features = ["serde"], optional = true }