forked from extern/nushell
add config option to limit external command completions (#6076)
* add config option to limit external command completions * fmt * small change * change name in config * change name in config again
This commit is contained in:
@ -59,6 +59,7 @@ pub struct Config {
|
||||
pub use_grid_icons: bool,
|
||||
pub footer_mode: FooterMode,
|
||||
pub float_precision: i64,
|
||||
pub max_external_completion_results: i64,
|
||||
pub filesize_format: String,
|
||||
pub use_ansi_coloring: bool,
|
||||
pub quick_completions: bool,
|
||||
@ -92,6 +93,7 @@ impl Default for Config {
|
||||
use_grid_icons: false,
|
||||
footer_mode: FooterMode::RowCount(25),
|
||||
float_precision: 4,
|
||||
max_external_completion_results: 100,
|
||||
filesize_format: "auto".into(),
|
||||
use_ansi_coloring: true,
|
||||
quick_completions: true,
|
||||
@ -249,6 +251,13 @@ impl Value {
|
||||
eprintln!("$config.partial_completions is not a bool")
|
||||
}
|
||||
}
|
||||
"max_external_completion_results" => {
|
||||
if let Ok(i) = value.as_integer() {
|
||||
config.max_external_completion_results = i;
|
||||
} else {
|
||||
eprintln!("$config.max_external_completion_results is not an integer")
|
||||
}
|
||||
}
|
||||
"completion_algorithm" => {
|
||||
if let Ok(v) = value.as_string() {
|
||||
config.completion_algorithm = v.to_lowercase();
|
||||
|
Reference in New Issue
Block a user