Avoid panic by accessing view handle by global in wrong window
View handles are window specific but this global will be doing things in all windows, that would cause a panic when it attempted to update a status bar mode indicator in a background window Co-Authored-By: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
@@ -43,6 +43,10 @@ impl<'a> VimTestContext<'a> {
|
||||
toolbar.add_item(project_search_bar, cx);
|
||||
})
|
||||
});
|
||||
workspace.status_bar().update(cx, |status_bar, cx| {
|
||||
let vim_mode_indicator = cx.add_view(ModeIndicator::new);
|
||||
status_bar.add_right_item(vim_mode_indicator, cx);
|
||||
});
|
||||
});
|
||||
|
||||
Self { cx }
|
||||
|
||||
Reference in New Issue
Block a user