mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 12:55:47 +02:00
Fix slice indexing (#6322)
* Return empty suggestions if no span contents is present * Fix slice indexing
This commit is contained in:
committed by
GitHub
parent
1d18f6947e
commit
4ab468e65f
@ -81,6 +81,9 @@ impl CommandCompletion {
|
||||
match_algorithm: MatchAlgorithm,
|
||||
) -> Vec<Suggestion> {
|
||||
let partial = working_set.get_span_contents(span);
|
||||
if partial.is_empty() {
|
||||
return Vec::new();
|
||||
}
|
||||
|
||||
let filter_predicate = |command: &[u8]| match_algorithm.matches_u8(command, partial);
|
||||
|
||||
|
Reference in New Issue
Block a user