Sync newly added diff hunks (#21759)
Fixed project diff multi buffer not expanding its diff until edited Release Notes: - N/A
This commit is contained in:
parent
a5355e92e3
commit
25a5ad54ae
2 changed files with 6 additions and 6 deletions
|
@ -243,7 +243,7 @@ impl ProjectDiffEditor {
|
||||||
.map_err(|_| anyhow!("Unexpected non-buffer"))
|
.map_err(|_| anyhow!("Unexpected non-buffer"))
|
||||||
})
|
})
|
||||||
.with_context(|| {
|
.with_context(|| {
|
||||||
format!("loading {} for git diff", entry_path.path.display())
|
format!("loading {:?} for git diff", entry_path.path)
|
||||||
})
|
})
|
||||||
.log_err()
|
.log_err()
|
||||||
else {
|
else {
|
||||||
|
@ -313,11 +313,11 @@ impl ProjectDiffEditor {
|
||||||
project_diff_editor
|
project_diff_editor
|
||||||
.update(&mut cx, |project_diff_editor, cx| {
|
.update(&mut cx, |project_diff_editor, cx| {
|
||||||
project_diff_editor.update_excerpts(id, new_changes, new_entry_order, cx);
|
project_diff_editor.update_excerpts(id, new_changes, new_entry_order, cx);
|
||||||
for change_set in change_sets {
|
|
||||||
project_diff_editor.editor.update(cx, |editor, cx| {
|
project_diff_editor.editor.update(cx, |editor, cx| {
|
||||||
|
for change_set in change_sets {
|
||||||
editor.diff_map.add_change_set(change_set, cx)
|
editor.diff_map.add_change_set(change_set, cx)
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
})
|
})
|
||||||
.ok();
|
.ok();
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -89,7 +89,6 @@ impl DiffMap {
|
||||||
self.snapshot
|
self.snapshot
|
||||||
.0
|
.0
|
||||||
.insert(buffer_id, change_set.read(cx).diff_to_buffer.clone());
|
.insert(buffer_id, change_set.read(cx).diff_to_buffer.clone());
|
||||||
Editor::sync_expanded_diff_hunks(self, buffer_id, cx);
|
|
||||||
self.diff_bases.insert(
|
self.diff_bases.insert(
|
||||||
buffer_id,
|
buffer_id,
|
||||||
DiffBaseState {
|
DiffBaseState {
|
||||||
|
@ -105,6 +104,7 @@ impl DiffMap {
|
||||||
change_set,
|
change_set,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
Editor::sync_expanded_diff_hunks(self, buffer_id, cx);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn hunks(&self, include_folded: bool) -> impl Iterator<Item = &ExpandedHunk> {
|
pub fn hunks(&self, include_folded: bool) -> impl Iterator<Item = &ExpandedHunk> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue