Synchronize modal commit editor with panel editor (#26068)
Release Notes: - Git Beta: Synchronized selections between the modal editor and the panel editor - Git Beta: Allow opening the commit modal even if we're unable to commit.
This commit is contained in:
parent
0a2d938ac5
commit
ebc5c213a2
6 changed files with 83 additions and 30 deletions
|
@ -168,6 +168,23 @@ impl Subscription {
|
|||
pub fn detach(mut self) {
|
||||
self.unsubscribe.take();
|
||||
}
|
||||
|
||||
/// Joins two subscriptions into a single subscription. Detach will
|
||||
/// detach both interior subscriptions.
|
||||
pub fn join(mut subscription_a: Self, mut subscription_b: Self) -> Self {
|
||||
let a_unsubscribe = subscription_a.unsubscribe.take();
|
||||
let b_unsubscribe = subscription_b.unsubscribe.take();
|
||||
Self {
|
||||
unsubscribe: Some(Box::new(move || {
|
||||
if let Some(self_unsubscribe) = a_unsubscribe {
|
||||
self_unsubscribe();
|
||||
}
|
||||
if let Some(other_unsubscribe) = b_unsubscribe {
|
||||
other_unsubscribe();
|
||||
}
|
||||
})),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Subscription {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue