From 29cb33300b1486c778e9318e87e60c26695c2520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Sat, 12 Dec 2020 20:18:44 +0900 Subject: [PATCH] wip --- helix-term/src/application.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 35d698d14..589aaf6e9 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -336,6 +336,7 @@ pub fn draw_and_swap(&mut self) { .draw(self.cache.diff(&self.surface).into_iter()); // swap the buffer std::mem::swap(&mut self.surface, &mut self.cache); + self.surface.reset(); // reset is faster than allocating new empty surface } pub fn render_cursor(&mut self, view: &View, prompt: Option<&Prompt>, viewport: Rect) { @@ -412,13 +413,6 @@ fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult { commands::insert::insert_char(&mut cx, c); } } - Mode::Normal => { - if let Some(command) = self.keymap[&Mode::Normal].get(&keys) { - command(&mut cx); - - // TODO: simplistic ensure cursor in view for now - } - } mode => { if let Some(command) = self.keymap[&mode].get(&keys) { command(&mut cx); @@ -484,7 +478,6 @@ pub fn new(mut args: Args, executor: &'a smol::Executor<'a>) -> Result