Fix panic when scrolling in project diff (#25771)
It may happen that the column for the scroll anchor is nonzero, and the adjustment we're doing here could result in an invalid point in that case. Release Notes: - N/A Co-authored-by: Max <max@zed.dev>
This commit is contained in:
parent
541a5c01a4
commit
eb4fad52df
1 changed files with 1 additions and 0 deletions
|
@ -281,6 +281,7 @@ impl ProjectDiff {
|
|||
let snapshot = multibuffer.snapshot(cx);
|
||||
let mut point = anchor.to_point(&snapshot);
|
||||
point.row = (point.row + 1).min(snapshot.max_row().0);
|
||||
point.column = 0;
|
||||
|
||||
let Some((_, buffer, _)) = self.multibuffer.read(cx).excerpt_containing(point, cx)
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue