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.

git_ui: Dismiss pickers only on active window (#41320)

Ben Heimberg24c1617e74ab
diff --git a/crates/picker/src/picker.rs b/crates/picker/src/picker.rs
index 1a2c6509f24..4e7dba59ad3 100644
--- a/crates/picker/src/picker.rs
+++ b/crates/picker/src/picker.rs
@@ -607,7 +607,7 @@ impl<D: PickerDelegate> Picker<D> {
self.update_matches(query, window, cx);
}
editor::EditorEvent::Blurred => {
- if self.is_modal {
+ if self.is_modal && window.is_window_active() {
self.cancel(&menu::Cancel, window, cx);
}
}
@@ -619,7 +619,9 @@ impl<D: PickerDelegate> Picker<D> {
let Head::Empty(_) = &self.head else {
panic!("unexpected call");
};
- self.cancel(&menu::Cancel, window, cx);
+ if window.is_window_active() {
+ self.cancel(&menu::Cancel, window, cx);
+ }
}
pub fn refresh_placeholder(&mut self, window: &mut Window, cx: &mut App) {