Fix two bugs in new diff hunk handling (#23990)
Closes https://github.com/zed-industries/zed/issues/23981 Release Notes: - Fixed a crash that could happen when expanding certain diff hunks - Fixed a bug where diff hunks were not syntax highlighted when reopening a project with previously-opened buffers.
This commit is contained in:
parent
9c3482083b
commit
b6e54ae2f1
3 changed files with 9 additions and 5 deletions
|
@ -3484,7 +3484,8 @@ impl MultiBufferSnapshot {
|
|||
let region = cursor.region()?;
|
||||
let buffer_start = if region.is_main_buffer {
|
||||
let start_overshoot = range.start.saturating_sub(region.range.start.key);
|
||||
region.buffer_range.start.key + start_overshoot
|
||||
(region.buffer_range.start.key + start_overshoot)
|
||||
.min(region.buffer_range.end.key)
|
||||
} else {
|
||||
cursor.main_buffer_position()?.key
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue