mirror of
https://github.com/nushell/nushell
synced 2024-11-11 15:37:07 +00:00
Fix completion crash (#3574)
This commit is contained in:
parent
4e6c2c0fa1
commit
bc6fa85a4b
1 changed files with 8 additions and 1 deletions
|
@ -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| {
|
||||
|
|
Loading…
Reference in a new issue