Don't crash if diagnostics span past EOF
This commit is contained in:
parent
d94410a678
commit
d4e1ec339e
1 changed files with 5 additions and 0 deletions
|
@ -1765,6 +1765,11 @@ impl<I: Iterator<Item = HighlightEvent>> Iterator for Merge<I> {
|
||||||
self.next_event = self.iter.next();
|
self.next_event = self.iter.next();
|
||||||
Some(event)
|
Some(event)
|
||||||
}
|
}
|
||||||
|
// can happen if deleting and cursor at EOF, and diagnostic reaches past the end
|
||||||
|
(None, Some((span, range))) => {
|
||||||
|
self.next_span = None;
|
||||||
|
None
|
||||||
|
}
|
||||||
(None, None) => None,
|
(None, None) => None,
|
||||||
e => unreachable!("{:?}", e),
|
e => unreachable!("{:?}", e),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue