mirror of
https://github.com/nushell/nushell
synced 2024-12-27 05:23:11 +00:00
Set to reedline main branch for development cycle (#5249)
Changes to reedline since `v0.4.0`: - vi normal mode `I` for inserting at line beginning - `InsertNewline` edit command that can be bound to `Alt-Enter` if desired to have line breaks without relying on the `Validator` - `ClearScreen` will directly clear the visible screen. `Signal::CtrlL` has been removed. - `ClearScrollback` will clear the screen and scrollback. Can be used to mimic macOS `Cmd-K` screen clearing. Helps with #5089
This commit is contained in:
parent
7e97be1dd4
commit
995d8db1fe
6 changed files with 6 additions and 9 deletions
3
Cargo.lock
generated
3
Cargo.lock
generated
|
@ -3524,8 +3524,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reedline"
|
name = "reedline"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/nushell/reedline?branch=main#2e2bdc54621643e7bee5ba2e2d9bf28e757074e0"
|
||||||
checksum = "01487ee6361e894f914d59f4310deea779222357637ac576f34741a18dd02ed2"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
|
|
|
@ -53,7 +53,7 @@ nu-table = { path = "./crates/nu-table", version = "0.61.1" }
|
||||||
nu-term-grid = { path = "./crates/nu-term-grid", version = "0.61.1" }
|
nu-term-grid = { path = "./crates/nu-term-grid", version = "0.61.1" }
|
||||||
pretty_env_logger = "0.4.0"
|
pretty_env_logger = "0.4.0"
|
||||||
rayon = "1.5.1"
|
rayon = "1.5.1"
|
||||||
reedline = { version = "0.4.0", features = ["bashisms"]}
|
reedline = { git = "https://github.com/nushell/reedline", branch = "main", features = ["bashisms"]}
|
||||||
is_executable = "1.0.1"
|
is_executable = "1.0.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
@ -18,11 +18,10 @@ nu-protocol = { path = "../nu-protocol", version = "0.61.1" }
|
||||||
nu-utils = { path = "../nu-utils", version = "0.61.1" }
|
nu-utils = { path = "../nu-utils", version = "0.61.1" }
|
||||||
nu-ansi-term = "0.45.1"
|
nu-ansi-term = "0.45.1"
|
||||||
nu-color-config = { path = "../nu-color-config", version = "0.61.1" }
|
nu-color-config = { path = "../nu-color-config", version = "0.61.1" }
|
||||||
|
reedline = { git = "https://github.com/nushell/reedline", branch = "main", features = ["bashisms"]}
|
||||||
crossterm = "0.23.0"
|
crossterm = "0.23.0"
|
||||||
miette = { version = "4.5.0", features = ["fancy"] }
|
miette = { version = "4.5.0", features = ["fancy"] }
|
||||||
thiserror = "1.0.29"
|
thiserror = "1.0.29"
|
||||||
reedline = { version = "0.4.0", features = ["bashisms"]}
|
|
||||||
|
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
is_executable = "1.0.1"
|
is_executable = "1.0.1"
|
||||||
|
|
|
@ -814,6 +814,7 @@ fn event_from_record(
|
||||||
"none" => ReedlineEvent::None,
|
"none" => ReedlineEvent::None,
|
||||||
"actionhandler" => ReedlineEvent::ActionHandler,
|
"actionhandler" => ReedlineEvent::ActionHandler,
|
||||||
"clearscreen" => ReedlineEvent::ClearScreen,
|
"clearscreen" => ReedlineEvent::ClearScreen,
|
||||||
|
"clearscrollback" => ReedlineEvent::ClearScrollback,
|
||||||
"historyhintcomplete" => ReedlineEvent::HistoryHintComplete,
|
"historyhintcomplete" => ReedlineEvent::HistoryHintComplete,
|
||||||
"historyhintwordcomplete" => ReedlineEvent::HistoryHintWordComplete,
|
"historyhintwordcomplete" => ReedlineEvent::HistoryHintWordComplete,
|
||||||
"ctrld" => ReedlineEvent::CtrlD,
|
"ctrld" => ReedlineEvent::CtrlD,
|
||||||
|
@ -881,6 +882,7 @@ fn edit_from_record(
|
||||||
let value = extract_value("value", cols, vals, span)?;
|
let value = extract_value("value", cols, vals, span)?;
|
||||||
EditCommand::InsertString(value.into_string("", config))
|
EditCommand::InsertString(value.into_string("", config))
|
||||||
}
|
}
|
||||||
|
"insertnewline" => EditCommand::InsertNewline,
|
||||||
"backspace" => EditCommand::Backspace,
|
"backspace" => EditCommand::Backspace,
|
||||||
"delete" => EditCommand::Delete,
|
"delete" => EditCommand::Delete,
|
||||||
"backspaceword" => EditCommand::BackspaceWord,
|
"backspaceword" => EditCommand::BackspaceWord,
|
||||||
|
|
|
@ -314,9 +314,6 @@ pub fn evaluate_repl(
|
||||||
println!();
|
println!();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Ok(Signal::CtrlL) => {
|
|
||||||
line_editor.clear_screen().into_diagnostic()?;
|
|
||||||
}
|
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
let message = err.to_string();
|
let message = err.to_string();
|
||||||
if !message.contains("duration") {
|
if !message.contains("duration") {
|
||||||
|
|
|
@ -79,7 +79,7 @@ unicode-segmentation = "1.8.0"
|
||||||
url = "2.2.1"
|
url = "2.2.1"
|
||||||
uuid = { version = "0.8.2", features = ["v4"] }
|
uuid = { version = "0.8.2", features = ["v4"] }
|
||||||
which = { version = "4.2.2", optional = true }
|
which = { version = "4.2.2", optional = true }
|
||||||
reedline = { version = "0.4.0", features = ["bashisms"]}
|
reedline = { git = "https://github.com/nushell/reedline", branch = "main", features = ["bashisms"]}
|
||||||
wax = { version = "0.4.0", features = ["diagnostics"] }
|
wax = { version = "0.4.0", features = ["diagnostics"] }
|
||||||
zip = { version="0.5.9", optional = true }
|
zip = { version="0.5.9", optional = true }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue