Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/application.rs')
| -rw-r--r-- | helix-term/src/application.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 7e968482..25875d45 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -63,6 +63,7 @@ type Terminal = tui::terminal::Terminal<TerminalBackend>; pub struct Application { compositor: Compositor, + keymaps: Keymaps, terminal: Terminal, pub editor: Editor, @@ -156,7 +157,8 @@ impl Application { let keys = Box::new(Map::new(Arc::clone(&config), |config: &Config| { &config.keys })); - let editor_view = Box::new(ui::EditorView::new(Keymaps::new(keys))); + let keymaps = Keymaps::new(keys); + let editor_view = Box::new(ui::EditorView::default()); compositor.push(editor_view); if args.load_tutor { @@ -241,6 +243,7 @@ impl Application { .context("build signal handler")?; let app = Self { + keymaps, compositor, terminal, editor, @@ -261,6 +264,7 @@ impl Application { async fn render(&mut self) { let mut cx = crate::compositor::Context { + keymaps: &mut self.keymaps, editor: &mut self.editor, jobs: &mut self.jobs, scroll: None, @@ -521,6 +525,7 @@ impl Application { pub async fn handle_idle_timeout(&mut self) { let mut cx = crate::compositor::Context { + keymaps: &mut self.keymaps, editor: &mut self.editor, jobs: &mut self.jobs, scroll: None, @@ -641,6 +646,7 @@ impl Application { event: Result<CrosstermEvent, crossterm::ErrorKind>, ) { let mut cx = crate::compositor::Context { + keymaps: &mut self.keymaps, editor: &mut self.editor, jobs: &mut self.jobs, scroll: None, |