1
0
mirror of https://github.com/nushell/nushell.git synced 2025-07-10 03:17:35 +02:00

Fix completion crash ()

This commit is contained in:
JT
2021-06-08 18:56:36 +12:00
committed by GitHub
parent 4e6c2c0fa1
commit bc6fa85a4b

@ -54,7 +54,14 @@ impl NuCompleter {
if locations.is_empty() {
(pos, Vec::new())
} else {
let pos = locations[0].span.start();
let mut pos = locations[0].span.start();
for location in &locations {
if location.span.start() < pos {
pos = location.span.start();
}
}
let suggestions = locations
.into_iter()
.flat_map(|location| {