From 803f9d4daff434ef5e4c6535d9d3f9fc70bd2de1 Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Sun, 16 Oct 2022 23:51:15 +0200 Subject: [PATCH] Upgrade reedline to latest dev version (#6778) * Reorder conditional deps for readability * Pull reedline from the most recent main branch * Map 'Submit' and 'SubmitOrNewline' events Introduced by nushell/reedline#490 --- Cargo.lock | 3 +-- Cargo.toml | 17 ++++++++++------- crates/nu-cli/src/reedline_config.rs | 2 ++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 863d630c2..9387ba93e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4071,8 +4071,7 @@ dependencies = [ [[package]] name = "reedline" version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311b256d0a325a92d685f1401fccf83341afba1a62d56bbfa3c98b87073db195" +source = "git+https://github.com/nushell/reedline.git?branch=main#f949f560f7bdd446a9f0af33baaf7298d2f3853a" dependencies = [ "chrono", "crossterm 0.24.0", diff --git a/Cargo.toml b/Cargo.toml index 73b00870d..149edb76f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,6 +64,14 @@ time = "0.3.12" openssl = { version = "0.10.38", features = ["vendored"], optional = true } signal-hook = { version = "0.3.14", default-features = false } + +[target.'cfg(windows)'.build-dependencies] +winres = "0.1" + +[target.'cfg(target_family = "unix")'.dependencies] +nix = "0.24" +atty = "0.2" + [dev-dependencies] nu-test-support = { path="./crates/nu-test-support", version = "0.69.2" } tempfile = "3.2.0" @@ -74,9 +82,6 @@ hamcrest2 = "0.3.0" rstest = {version = "0.15.0", default-features = false} itertools = "0.10.3" -[target.'cfg(windows)'.build-dependencies] -winres = "0.1" - [features] plugin = ["nu-plugin", "nu-cli/plugin", "nu-parser/plugin", "nu-command/plugin", "nu-protocol/plugin", "nu-engine/plugin"] extra = ["default", "dataframe", "database"] @@ -122,7 +127,5 @@ debug = false name = "nu" path = "src/main.rs" -[target.'cfg(target_family = "unix")'.dependencies] -nix = "0.24" -atty = "0.2" - +[patch.crates-io] +reedline = { git = "https://github.com/nushell/reedline.git", branch = "main" } diff --git a/crates/nu-cli/src/reedline_config.rs b/crates/nu-cli/src/reedline_config.rs index d2dba8be2..dfa8f8f1e 100644 --- a/crates/nu-cli/src/reedline_config.rs +++ b/crates/nu-cli/src/reedline_config.rs @@ -822,6 +822,8 @@ fn event_from_record( "ctrld" => ReedlineEvent::CtrlD, "ctrlc" => ReedlineEvent::CtrlC, "enter" => ReedlineEvent::Enter, + "submit" => ReedlineEvent::Submit, + "submitornewline" => ReedlineEvent::SubmitOrNewline, "esc" | "escape" => ReedlineEvent::Esc, "up" => ReedlineEvent::Up, "down" => ReedlineEvent::Down,