diff --git a/crates/nu-cli/src/completions/completion_options.rs b/crates/nu-cli/src/completions/completion_options.rs index 7022d7988d..493f30d341 100644 --- a/crates/nu-cli/src/completions/completion_options.rs +++ b/crates/nu-cli/src/completions/completion_options.rs @@ -102,7 +102,11 @@ impl NuMatcher<'_, T> { options, needle: needle.to_owned(), state: State::Fuzzy { - matcher: Matcher::new(Config::DEFAULT), + matcher: Matcher::new({ + let mut cfg = Config::DEFAULT; + cfg.prefer_prefix = true; + cfg + }), atom, items: Vec::new(), }, diff --git a/crates/nu-lsp/src/symbols.rs b/crates/nu-lsp/src/symbols.rs index bea7bab3e8..07b01d2028 100644 --- a/crates/nu-lsp/src/symbols.rs +++ b/crates/nu-lsp/src/symbols.rs @@ -80,7 +80,11 @@ pub(crate) struct SymbolCache { impl SymbolCache { pub fn new() -> Self { SymbolCache { - matcher: Matcher::new(Config::DEFAULT), + matcher: Matcher::new({ + let mut cfg = Config::DEFAULT; + cfg.prefer_prefix = true; + cfg + }), cache: BTreeMap::new(), dirty_flags: BTreeMap::new(), }