mirror of https://github.com/helix-editor/helix
fix: do not use a Cell for self.active
parent
069ca339a6
commit
2b28ce94be
|
@ -17,9 +17,7 @@ pub(super) fn register_hooks(_handlers: &Handlers) {
|
||||||
});
|
});
|
||||||
register_hook!(move |event: &mut OnModeSwitch<'_, '_>| {
|
register_hook!(move |event: &mut OnModeSwitch<'_, '_>| {
|
||||||
for (view, _) in event.cx.editor.tree.views_mut() {
|
for (view, _) in event.cx.editor.tree.views_mut() {
|
||||||
view.diagnostics_handler
|
view.diagnostics_handler.active = event.new_mode != Mode::Insert;
|
||||||
.active
|
|
||||||
.set(event.new_mode != Mode::Insert);
|
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
});
|
});
|
||||||
|
|
|
@ -59,7 +59,7 @@ pub struct DiagnosticsHandler {
|
||||||
generation: Cell<usize>,
|
generation: Cell<usize>,
|
||||||
last_doc: Cell<DocumentId>,
|
last_doc: Cell<DocumentId>,
|
||||||
last_cursor_line: Cell<usize>,
|
last_cursor_line: Cell<usize>,
|
||||||
pub active: Cell<bool>,
|
pub active: bool,
|
||||||
pub events: Sender<DiagnosticEvent>,
|
pub events: Sender<DiagnosticEvent>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ pub struct DiagnosticsHandler {
|
||||||
// but to fix that larger architecutre changes are needed
|
// but to fix that larger architecutre changes are needed
|
||||||
impl Clone for DiagnosticsHandler {
|
impl Clone for DiagnosticsHandler {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
Self::new(self.active.take())
|
Self::new(self.active)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue