aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/application.rs
diff options
context:
space:
mode:
authorGokul Soumya2022-10-11 00:10:01 +0000
committerGitHub2022-10-11 00:10:01 +0000
commit001858b11fb60926725e061ec31dfa9c77562148 (patch)
tree810b288609044d09044e65d30a26e3390f6d0d27 /helix-term/src/application.rs
parent5e1c589d43ee92412a97bfb0dd3d5b333eac4971 (diff)
Propagate idle timeout event to components (#3172)
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index c7d98fce..4bb36b59 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -435,18 +435,13 @@ impl Application {
}
pub fn handle_idle_timeout(&mut self) {
- use crate::compositor::EventResult;
- let editor_view = self
- .compositor
- .find::<ui::EditorView>()
- .expect("expected at least one EditorView");
-
let mut cx = crate::compositor::Context {
editor: &mut self.editor,
jobs: &mut self.jobs,
scroll: None,
};
- if let EventResult::Consumed(_) = editor_view.handle_idle_timeout(&mut cx) {
+ let should_render = self.compositor.handle_event(&Event::IdleTimeout, &mut cx);
+ if should_render {
self.render();
}
}