Improve completions inside of a pipeline (#3575)

* Fix completion crash

* Improve inner completions
This commit is contained in:
JT 2021-06-08 19:48:02 +12:00 committed by GitHub
parent bc6fa85a4b
commit 2e968d2557
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
} }
} }