mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 09:55:42 +02:00
Add NU config to allow user be able to turn off external completion (#5773)
* 06-07-wsl * 06-07-linux-issue-with-delete-input * 06-08-2023 * 06-08-Linux * commit for merge * Fix unit test * format * clean code * Add flag to turn off external completion * change env var to config * Fix comment Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
This commit is contained in:
@ -76,6 +76,7 @@ pub struct Config {
|
||||
pub disable_table_indexes: bool,
|
||||
pub cd_with_abbreviations: bool,
|
||||
pub case_sensitive_completions: bool,
|
||||
pub enable_external_completion: bool,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@ -107,6 +108,7 @@ impl Default for Config {
|
||||
disable_table_indexes: false,
|
||||
cd_with_abbreviations: false,
|
||||
case_sensitive_completions: false,
|
||||
enable_external_completion: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -323,6 +325,13 @@ impl Value {
|
||||
eprintln!("$config.case_sensitive_completions is not a bool")
|
||||
}
|
||||
}
|
||||
"enable_external_completion" => {
|
||||
if let Ok(b) = value.as_bool() {
|
||||
config.enable_external_completion = b;
|
||||
} else {
|
||||
eprintln!("$config.enable_external_completion is not a bool")
|
||||
}
|
||||
}
|
||||
x => {
|
||||
eprintln!("$config.{} is an unknown config setting", x)
|
||||
}
|
||||
|
Reference in New Issue
Block a user