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.

Align dispatch_keystroke with other uses of ancestors iterator and filter out non-existant views

Mikayla Maki578c69476d8b
diff --git a/crates/gpui/src/app.rs b/crates/gpui/src/app.rs
index b4d88a72709..d476ecdef90 100644
--- a/crates/gpui/src/app.rs
+++ b/crates/gpui/src/app.rs
@@ -1479,15 +1479,11 @@ impl MutableAppContext {
if let Some(focused_view_id) = self.focused_view_id(window_id) {
let dispatch_path = self
.ancestors(window_id, focused_view_id)
- .map(|view_id| {
- (
- view_id,
- self.cx
- .views
- .get(&(window_id, view_id))
- .unwrap()
- .keymap_context(self.as_ref()),
- )
+ .filter_map(|view_id| {
+ self.cx
+ .views
+ .get(&(window_id, view_id))
+ .map(|view| (view_id, view.keymap_context(self.as_ref())))
})
.collect();