mirror of
https://github.com/nushell/nushell
synced 2024-12-30 15:03:25 +00:00
Improve completions inside of a pipeline (#3575)
* Fix completion crash * Improve inner completions
This commit is contained in:
parent
bc6fa85a4b
commit
2e968d2557
1 changed files with 7 additions and 5 deletions
|
@ -228,11 +228,13 @@ pub fn completion_location(line: &str, block: &Block, pos: usize) -> Vec<Complet
|
||||||
item: LocationType::Command,
|
item: LocationType::Command,
|
||||||
} = &rloc
|
} = &rloc
|
||||||
{
|
{
|
||||||
output.push(LocationType::Command.spanned(Span::new(
|
if span.start() <= pos {
|
||||||
span.start(),
|
output.push(
|
||||||
locations[locations.len() - 1].span.end(),
|
LocationType::Command
|
||||||
)));
|
.spanned(Span::new(span.start(), pos)),
|
||||||
break;
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue