alpha -> alphabetical
This commit is contained in:
parent
e22d8fa6c7
commit
3503d0f52a
|
@ -109,7 +109,7 @@ impl Completer for CustomCompletion {
|
|||
None => completion_options.match_algorithm,
|
||||
},
|
||||
sort: if should_sort {
|
||||
CompletionSort::Alpha
|
||||
CompletionSort::Alphabetical
|
||||
} else {
|
||||
CompletionSort::Default
|
||||
},
|
||||
|
|
|
@ -112,7 +112,7 @@ fn fuzzy_alpha_sort_completer() -> NuCompleter {
|
|||
|
||||
let config = r#"
|
||||
$env.config.completions.algorithm = "fuzzy"
|
||||
$env.config.completions.sort = "alpha"
|
||||
$env.config.completions.sort = "alphabetical"
|
||||
"#;
|
||||
assert!(support::merge_input(config.as_bytes(), &mut engine, &mut stack, dir).is_ok());
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ impl ReconstructVal for CompletionAlgorithm {
|
|||
pub enum CompletionSort {
|
||||
#[default]
|
||||
Default,
|
||||
Alpha,
|
||||
Alphabetical,
|
||||
}
|
||||
|
||||
impl FromStr for CompletionSort {
|
||||
|
@ -48,7 +48,7 @@ impl FromStr for CompletionSort {
|
|||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s.to_ascii_lowercase().as_str() {
|
||||
"default" => Ok(Self::Default),
|
||||
"alpha" => Ok(Self::Alpha),
|
||||
"alphabetical" => Ok(Self::Alphabetical),
|
||||
_ => Err("expected either 'default' or 'alpha'"),
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ impl ReconstructVal for CompletionSort {
|
|||
fn reconstruct_value(&self, span: Span) -> Value {
|
||||
let str = match self {
|
||||
Self::Default => "default",
|
||||
Self::Alpha => "alpha",
|
||||
Self::Alphabetical => "alphabetical",
|
||||
};
|
||||
Value::string(str, span)
|
||||
}
|
||||
|
|
|
@ -205,7 +205,7 @@ $env.config = {
|
|||
quick: true # set this to false to prevent auto-selecting completions when only one remains
|
||||
partial: true # set this to false to prevent partial filling of the prompt
|
||||
algorithm: "prefix" # prefix or fuzzy
|
||||
sort: "default" # default (choose based on algorithm) or alpha (always sort alphabetically)
|
||||
sort: "default" # "default" (choose based on algorithm) or "alphabetical"
|
||||
external: {
|
||||
enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow
|
||||
max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options
|
||||
|
|
Loading…
Reference in New Issue
Block a user