mirror of
https://github.com/nushell/nushell.git
synced 2025-08-19 09:22:27 +02:00
fix(completion): invalid prefix for external path argument with spaces (#15998)
Fixes the default behavior of #15790 # Description As for the mentioned carapace version: `cat ~"/Downloads/Obsidian Vault/"`, the problem lies in the unexpanded home directory `~`. Either we encourage users to manually expand that in `$env.config.completions.external.completer` or open an issue on the carapace project. # User-Facing Changes bug fix # Tests + Formatting Adjusted # After Submitting
This commit is contained in:
@@ -466,6 +466,14 @@ impl NuCompleter {
|
||||
return suggestions;
|
||||
}
|
||||
}
|
||||
// for external path arguments with spaces, please check issue #15790
|
||||
if suggestions.is_empty() {
|
||||
let (new_span, prefix) =
|
||||
strip_placeholder_if_any(working_set, &span, strip);
|
||||
let ctx = Context::new(working_set, new_span, prefix, offset);
|
||||
suggestions.extend(self.process_completion(&mut FileCompletion, &ctx));
|
||||
return suggestions;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user