use simpler reedline (#6016)

This commit is contained in:
JT 2022-07-12 13:25:31 +12:00 committed by GitHub
parent c1bf9fd897
commit a5470b2362
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 6 additions and 20 deletions

3
Cargo.lock generated
View file

@ -3851,8 +3851,7 @@ dependencies = [
[[package]]
name = "reedline"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d064ec92a21deb048c440b6461ccf0d0babdb5f2160ea9dfac451bc7b4b556e2"
source = "git+https://github.com/nushell/reedline.git#59f7144d721cd573f629048e753f163f2652334f"
dependencies = [
"chrono",
"crossterm",

View file

@ -52,7 +52,7 @@ nu-system = { path = "./crates/nu-system", version = "0.65.1" }
nu-table = { path = "./crates/nu-table", version = "0.65.1" }
nu-term-grid = { path = "./crates/nu-term-grid", version = "0.65.1" }
nu-utils = { path = "./crates/nu-utils", version = "0.65.1" }
reedline = { version = "0.8.0", features = ["bashisms", "sqlite"]}
reedline = { git = "https://github.com/nushell/reedline.git", features = ["bashisms", "sqlite"]}
pretty_env_logger = "0.4.0"
rayon = "1.5.1"
is_executable = "1.0.1"

View file

@ -18,7 +18,7 @@ nu-protocol = { path = "../nu-protocol", version = "0.65.1" }
nu-utils = { path = "../nu-utils", version = "0.65.1" }
nu-ansi-term = "0.46.0"
nu-color-config = { path = "../nu-color-config", version = "0.65.1" }
reedline = { version = "0.8.0", features = ["bashisms", "sqlite"]}
reedline = { git = "https://github.com/nushell/reedline.git", features = ["bashisms", "sqlite"]}
crossterm = "0.23.0"
miette = { version = "5.1.0", features = ["fancy"] }
thiserror = "1.0.31"

View file

@ -148,7 +148,6 @@ pub fn evaluate_repl(
engine_state: engine_state.clone(),
config: config.clone(),
}))
.with_animation(config.animate_prompt)
.with_validator(Box::new(NuValidator {
engine_state: engine_state.clone(),
}))

View file

@ -84,7 +84,7 @@ unicode-segmentation = "1.8.0"
url = "2.2.1"
uuid = { version = "1.1.2", features = ["v4"] }
which = { version = "4.2.2", optional = true }
reedline = { version = "0.8.0", features = ["bashisms", "sqlite"]}
reedline = { git = "https://github.com/nushell/reedline.git", features = ["bashisms", "sqlite"]}
wax = { version = "0.5.0", features = ["diagnostics"] }
rusqlite = { version = "0.27.0", features = ["bundled"], optional = true }
sqlparser = { version = "0.16.0", features = ["serde"], optional = true }

View file

@ -2,8 +2,6 @@ use crate::{ShellError, Span, Value};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
const ANIMATE_PROMPT_DEFAULT: bool = true;
/// Definition of a parsed keybinding from the config object
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct ParsedKeybinding {
@ -56,7 +54,6 @@ pub struct Config {
pub color_config: HashMap<String, Value>,
pub use_grid_icons: bool,
pub footer_mode: FooterMode,
pub animate_prompt: bool,
pub float_precision: i64,
pub filesize_format: String,
pub use_ansi_coloring: bool,
@ -89,7 +86,6 @@ impl Default for Config {
color_config: HashMap::new(),
use_grid_icons: false,
footer_mode: FooterMode::RowCount(25),
animate_prompt: ANIMATE_PROMPT_DEFAULT,
float_precision: 4,
filesize_format: "auto".into(),
use_ansi_coloring: true,
@ -195,13 +191,6 @@ impl Value {
eprintln!("$config.footer_mode is not a string")
}
}
"animate_prompt" => {
if let Ok(b) = value.as_bool() {
config.animate_prompt = b;
} else {
eprintln!("$config.animate_prompt is not a bool")
}
}
"float_precision" => {
if let Ok(i) = value.as_integer() {
config.float_precision = i;

View file

@ -243,7 +243,6 @@ let-env config = {
quick_completions: true # set this to false to prevent auto-selecting completions when only one remains
partial_completions: true # set this to false to prevent partial filling of the prompt
completion_algorithm: "prefix" # prefix, fuzzy
animate_prompt: false # redraw the prompt every second
float_precision: 2
# buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
use_ansi_coloring: true

View file

@ -11,9 +11,9 @@ fn outcome_err(
engine_state: &EngineState,
error: &(dyn miette::Diagnostic + Send + Sync + 'static),
) -> Outcome {
let working_set = StateWorkingSet::new(&engine_state);
let working_set = StateWorkingSet::new(engine_state);
eprintln!("{}", format!("Error: {:?}", CliError(error, &working_set)));
eprintln!("Error: {:?}", CliError(error, &working_set));
Outcome {
out: String::new(),