Merge pull request #2302 from zed-industries/fix-dispatch-path-panic

Align dispatch_keystroke with other uses of ancestors iterator
This commit is contained in:
Mikayla Maki 2023-03-17 16:34:00 -07:00 committed by GitHub
commit 5a1bbb96ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1479,15 +1479,11 @@ impl MutableAppContext {
if let Some(focused_view_id) = self.focused_view_id(window_id) { if let Some(focused_view_id) = self.focused_view_id(window_id) {
let dispatch_path = self let dispatch_path = self
.ancestors(window_id, focused_view_id) .ancestors(window_id, focused_view_id)
.map(|view_id| { .filter_map(|view_id| {
( self.cx
view_id, .views
self.cx .get(&(window_id, view_id))
.views .map(|view| (view_id, view.keymap_context(self.as_ref())))
.get(&(window_id, view_id))
.unwrap()
.keymap_context(self.as_ref()),
)
}) })
.collect(); .collect();