Fix diff recalculation hang (#28377)
Fixes https://github.com/zed-industries/zed/issues/26039 Release Notes: - Fixed an issue where diffs stopped updating closing and reopening them after staging hunks. - Fixed a bug where staging a hunk while the cursor was in a deleted line would move the cursor erroneously. --------- Co-authored-by: Cole Miller <m@cole-miller.net> Co-authored-by: João Marcos <marcospb19@hotmail.com>
This commit is contained in:
parent
ffdf725f32
commit
294a1b63c0
6 changed files with 544 additions and 441 deletions
|
@ -356,7 +356,7 @@ async fn build_buffer_diff(
|
|||
|
||||
cx.new(|cx| {
|
||||
let mut diff = BufferDiff::new(&buffer.text, cx);
|
||||
diff.set_snapshot(diff_snapshot, &buffer.text, None, cx);
|
||||
diff.set_snapshot(diff_snapshot, &buffer.text, cx);
|
||||
diff
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1501,7 +1501,6 @@ mod tests {
|
|||
.unindent(),
|
||||
);
|
||||
|
||||
eprintln!(">>>>>>>> git restore");
|
||||
let prev_buffer_hunks =
|
||||
cx.update_window_entity(&buffer_editor, |buffer_editor, window, cx| {
|
||||
let snapshot = buffer_editor.snapshot(window, cx);
|
||||
|
@ -1525,7 +1524,6 @@ mod tests {
|
|||
});
|
||||
assert_eq!(new_buffer_hunks.as_slice(), &[]);
|
||||
|
||||
eprintln!(">>>>>>>> modify");
|
||||
cx.update_window_entity(&buffer_editor, |buffer_editor, window, cx| {
|
||||
buffer_editor.set_text("different\n", window, cx);
|
||||
buffer_editor.save(false, project.clone(), window, cx)
|
||||
|
@ -1554,8 +1552,8 @@ mod tests {
|
|||
cx,
|
||||
&"
|
||||
- original
|
||||
+ ˇdifferent
|
||||
"
|
||||
+ different
|
||||
ˇ"
|
||||
.unindent(),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue