Add support for quick completions (#927)

This commit is contained in:
JT
2022-02-04 10:30:21 -05:00
committed by GitHub
parent 1a246d141e
commit 522a53af68
5 changed files with 13 additions and 1 deletions

View File

@ -15,5 +15,6 @@ nu-color-config = { path = "../nu-color-config" }
miette = { version = "3.0.0", features = ["fancy"] }
thiserror = "1.0.29"
reedline = { git = "https://github.com/nushell/reedline", branch = "main" }
log = "0.4"
is_executable = "1.0.1"

View File

@ -59,6 +59,7 @@ pub struct Config {
pub float_precision: i64,
pub filesize_format: String,
pub use_ansi_coloring: bool,
pub quick_completions: bool,
pub env_conversions: HashMap<String, EnvConversion>,
pub edit_mode: String,
pub max_history_size: i64,
@ -81,6 +82,7 @@ impl Default for Config {
float_precision: 4,
filesize_format: "auto".into(),
use_ansi_coloring: true,
quick_completions: false,
env_conversions: HashMap::new(), // TODO: Add default conversoins
edit_mode: "emacs".into(),
max_history_size: 1000,
@ -185,6 +187,13 @@ impl Value {
eprintln!("$config.use_ansi_coloring is not a bool")
}
}
"quick_completions" => {
if let Ok(b) = value.as_bool() {
config.quick_completions = b;
} else {
eprintln!("$config.quick_completions is not a bool")
}
}
"filesize_format" => {
if let Ok(v) = value.as_string() {
config.filesize_format = v.to_lowercase();