mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
add case_sensitive_completions config option (#5646)
This commit is contained in:
@ -37,7 +37,10 @@ impl NuCompleter {
|
||||
) -> Vec<Suggestion> {
|
||||
let config = self.engine_state.get_config();
|
||||
|
||||
let mut options = CompletionOptions::default();
|
||||
let mut options = CompletionOptions {
|
||||
case_sensitive: config.case_sensitive_completions,
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
if config.completion_algorithm == "fuzzy" {
|
||||
options.match_algorithm = MatchAlgorithm::Fuzzy;
|
||||
|
@ -75,6 +75,7 @@ pub struct Config {
|
||||
pub buffer_editor: String,
|
||||
pub disable_table_indexes: bool,
|
||||
pub cd_with_abbreviations: bool,
|
||||
pub case_sensitive_completions: bool,
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
@ -105,6 +106,7 @@ impl Default for Config {
|
||||
buffer_editor: String::new(),
|
||||
disable_table_indexes: false,
|
||||
cd_with_abbreviations: false,
|
||||
case_sensitive_completions: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -311,7 +313,14 @@ impl Value {
|
||||
if let Ok(b) = value.as_bool() {
|
||||
config.cd_with_abbreviations = b;
|
||||
} else {
|
||||
eprintln!("$config.disable_table_indexes is not a bool")
|
||||
eprintln!("$config.cd_with_abbreviations is not a bool")
|
||||
}
|
||||
}
|
||||
"case_sensitive_completions" => {
|
||||
if let Ok(b) = value.as_bool() {
|
||||
config.case_sensitive_completions = b;
|
||||
} else {
|
||||
eprintln!("$config.case_sensitive_completions is not a bool")
|
||||
}
|
||||
}
|
||||
x => {
|
||||
|
Reference in New Issue
Block a user