Emit an event when adding a worktree to a project

This commit is contained in:
Max Brunsfeld 2022-05-27 10:48:47 -07:00
parent 04bd57b2c7
commit a1a4c70845
2 changed files with 13 additions and 10 deletions

View file

@ -139,6 +139,7 @@ pub struct Collaborator {
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum Event {
ActiveEntryChanged(Option<ProjectEntryId>),
WorktreeAdded,
WorktreeRemoved(WorktreeId),
DiskBasedDiagnosticsStarted,
DiskBasedDiagnosticsUpdated,
@ -3637,6 +3638,7 @@ impl Project {
self.worktrees
.push(WorktreeHandle::Weak(worktree.downgrade()));
}
cx.emit(Event::WorktreeAdded);
cx.notify();
}