Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix flicker when reverting last hunk from the project diff view (#26706)

Conrad Irwin8361c32a348c
diff --git a/crates/git_ui/src/project_diff.rs b/crates/git_ui/src/project_diff.rs
index f0fcd488e0d..db3302116ea 100644
--- a/crates/git_ui/src/project_diff.rs
+++ b/crates/git_ui/src/project_diff.rs
@@ -308,7 +308,7 @@ impl ProjectDiff {
fn handle_editor_event(
&mut self,
- _: &Entity<Editor>,
+ editor: &Entity<Editor>,
event: &EditorEvent,
window: &mut Window,
cx: &mut Context<Self>,
@@ -330,6 +330,11 @@ impl ProjectDiff {
}
_ => {}
}
+ if editor.focus_handle(cx).contains_focused(window, cx) {
+ if self.multibuffer.read(cx).is_empty() {
+ self.focus_handle.focus(window)
+ }
+ }
}
fn load_buffers(&mut self, cx: &mut Context<Self>) -> Vec<Task<Result<DiffBuffer>>> {