diff --git a/helix-term/src/handlers/diagnostics.rs b/helix-term/src/handlers/diagnostics.rs index 70e8ecc2..3e44d416 100644 --- a/helix-term/src/handlers/diagnostics.rs +++ b/helix-term/src/handlers/diagnostics.rs @@ -17,9 +17,7 @@ pub(super) fn register_hooks(_handlers: &Handlers) { }); register_hook!(move |event: &mut OnModeSwitch<'_, '_>| { for (view, _) in event.cx.editor.tree.views_mut() { - view.diagnostics_handler - .active - .set(event.new_mode != Mode::Insert); + view.diagnostics_handler.active = event.new_mode != Mode::Insert; } Ok(()) }); diff --git a/helix-view/src/handlers/diagnostics.rs b/helix-view/src/handlers/diagnostics.rs index e582197d..ebf4e4fa 100644 --- a/helix-view/src/handlers/diagnostics.rs +++ b/helix-view/src/handlers/diagnostics.rs @@ -59,7 +59,7 @@ pub struct DiagnosticsHandler { generation: Cell, last_doc: Cell, last_cursor_line: Cell, - pub active: Cell, + pub active: bool, pub events: Sender, } @@ -69,7 +69,7 @@ pub struct DiagnosticsHandler { // but to fix that larger architecutre changes are needed impl Clone for DiagnosticsHandler { fn clone(&self) -> Self { - Self::new(self.active.take()) + Self::new(self.active) } }