From 5eee33c7e4b48b206e2aafafe93203db1dd3ec3a Mon Sep 17 00:00:00 2001 From: Dan Davison Date: Thu, 20 Oct 2022 06:39:48 -0400 Subject: [PATCH] Tab inline completion (#6802) * Make Tab insert (partial) completion instead of select next menu item * Use reedline feature branch Co-authored-by: JT <547158+jntrnr@users.noreply.github.com> --- Cargo.lock | 3 +-- Cargo.toml | 2 +- crates/nu-cli/Cargo.toml | 2 +- crates/nu-cli/src/reedline_config.rs | 2 +- crates/nu-command/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63d9f34810..37aa87d656 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4071,8 +4071,7 @@ dependencies = [ [[package]] name = "reedline" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555a4285d183a94d140d749712a6600b10e70d7cd6aef91e3cfb65ba09b1d75e" +source = "git+https://github.com/dandavison/reedline.git?branch=tab-inline-completion#2a8e6c7c3ae610e15c91ad24d45c5b2ad0a1615b" dependencies = [ "chrono", "crossterm 0.24.0", diff --git a/Cargo.toml b/Cargo.toml index f41a1ccb8e..89045ef606 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,7 +52,7 @@ nu-system = { path = "./crates/nu-system", version = "0.70.1" } nu-table = { path = "./crates/nu-table", version = "0.70.1" } nu-term-grid = { path = "./crates/nu-term-grid", version = "0.70.1" } nu-utils = { path = "./crates/nu-utils", version = "0.70.1" } -reedline = { version = "0.13.0", features = ["bashisms", "sqlite"]} +reedline = { git = "https://github.com/dandavison/reedline.git", branch="tab-inline-completion", features = ["bashisms", "sqlite"]} rayon = "1.5.1" is_executable = "1.0.1" diff --git a/crates/nu-cli/Cargo.toml b/crates/nu-cli/Cargo.toml index 94631f80bb..ec139cb070 100644 --- a/crates/nu-cli/Cargo.toml +++ b/crates/nu-cli/Cargo.toml @@ -20,7 +20,7 @@ nu-protocol = { path = "../nu-protocol", version = "0.70.1" } nu-utils = { path = "../nu-utils", version = "0.70.1" } nu-ansi-term = "0.46.0" nu-color-config = { path = "../nu-color-config", version = "0.70.1" } -reedline = { version = "0.13.0", features = ["bashisms", "sqlite"]} +reedline = { git = "https://github.com/dandavison/reedline.git", branch="tab-inline-completion", 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 dfa8f8f1ea..c2032267aa 100644 --- a/crates/nu-cli/src/reedline_config.rs +++ b/crates/nu-cli/src/reedline_config.rs @@ -491,7 +491,7 @@ fn add_menu_keybindings(keybindings: &mut Keybindings) { KeyCode::Tab, ReedlineEvent::UntilFound(vec![ ReedlineEvent::Menu("completion_menu".to_string()), - ReedlineEvent::MenuNext, + ReedlineEvent::Edit(vec![EditCommand::Complete]), ]), ); diff --git a/crates/nu-command/Cargo.toml b/crates/nu-command/Cargo.toml index 69f185aa27..1d927e322d 100644 --- a/crates/nu-command/Cargo.toml +++ b/crates/nu-command/Cargo.toml @@ -88,7 +88,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.13.0", features = ["bashisms", "sqlite"]} +reedline = { git = "https://github.com/dandavison/reedline.git", branch="tab-inline-completion", 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 }