mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 14:40:06 +02:00
Add support for quick completions (#927)
This commit is contained in:
@ -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"
|
||||
|
@ -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();
|
||||
|
Reference in New Issue
Block a user