Use try_global()

This commit is contained in:
Joseph T. Lyons 2024-01-18 00:58:50 -05:00
parent 933fb87013
commit b807e6fe80
10 changed files with 52 additions and 70 deletions

View file

@ -28,11 +28,10 @@ impl ModeIndicator {
fn update_mode(&mut self, cx: &mut ViewContext<Self>) {
// Vim doesn't exist in some tests
if !cx.has_global::<Vim>() {
let Some(vim) = cx.try_global::<Vim>() else {
return;
}
};
let vim = Vim::read(cx);
if vim.enabled {
self.mode = Some(vim.state().mode);
} else {