Fix diff indicators not restored when reopening remote project (#31384)
Closes #30917 Release Notes: - Fix diff indicators not restored when reopening remote project --------- Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
parent
b686fb2917
commit
c766f52f88
6 changed files with 192 additions and 7 deletions
|
@ -134,6 +134,7 @@ use project::{
|
|||
},
|
||||
session::{Session, SessionEvent},
|
||||
},
|
||||
git_store::{GitStoreEvent, RepositoryEvent},
|
||||
project_settings::DiagnosticSeverity,
|
||||
};
|
||||
|
||||
|
@ -1866,6 +1867,31 @@ impl Editor {
|
|||
_ => {}
|
||||
},
|
||||
));
|
||||
let git_store = project.read(cx).git_store().clone();
|
||||
let project = project.clone();
|
||||
project_subscriptions.push(cx.subscribe(&git_store, move |this, _, event, cx| {
|
||||
match event {
|
||||
GitStoreEvent::RepositoryUpdated(
|
||||
_,
|
||||
RepositoryEvent::Updated {
|
||||
new_instance: true, ..
|
||||
},
|
||||
_,
|
||||
) => {
|
||||
this.load_diff_task = Some(
|
||||
update_uncommitted_diff_for_buffer(
|
||||
cx.entity(),
|
||||
&project,
|
||||
this.buffer.read(cx).all_buffers(),
|
||||
this.buffer.clone(),
|
||||
cx,
|
||||
)
|
||||
.shared(),
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue