Don't panic when navigation data contains invalid anchors and/or points
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
cde5a45318
commit
c9478cab09
2 changed files with 26 additions and 3 deletions
|
@ -250,7 +250,7 @@ impl Item for Editor {
|
|||
let offset = if buffer.can_resolve(&data.cursor_anchor) {
|
||||
data.cursor_anchor.to_point(&buffer)
|
||||
} else {
|
||||
buffer.clip_point(data.cursor_point, Bias::Left)
|
||||
buffer.clip_point(data.cursor_position, Bias::Left)
|
||||
};
|
||||
let newest_selection = self.newest_selection_with_snapshot::<Point>(&buffer);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue