@@ -336,6 +336,7 @@ impl Renderer {
336 .draw(self.cache.diff(&self.surface).into_iter());
336 .draw(self.cache.diff(&self.surface).into_iter());
337 // swap the buffer
337 // swap the buffer
338 std::mem::swap(&mut self.surface, &mut self.cache);
338 std::mem::swap(&mut self.surface, &mut self.cache);
339+ self.surface.reset(); // reset is faster than allocating new empty surface
341 pub fn render_cursor(&mut self, view: &View, prompt: Option<&Prompt>, viewport: Rect) {
342 pub fn render_cursor(&mut self, view: &View, prompt: Option<&Prompt>, viewport: Rect) {
@@ -412,13 +413,6 @@ impl Component for EditorView {
412 commands::insert::insert_char(&mut cx, c);
413 commands::insert::insert_char(&mut cx, c);
416− if let Some(command) = self.keymap[&Mode::Normal].get(&keys) {
419− // TODO: simplistic ensure cursor in view for now
422 mode => {
416 mode => {
423 if let Some(command) = self.keymap[&mode].get(&keys) {
417 if let Some(command) = self.keymap[&mode].get(&keys) {
424 command(&mut cx);
418 command(&mut cx);
@@ -484,7 +478,6 @@ impl<'a> Application<'a> {
486 fn render(&mut self) {
480 fn render(&mut self) {
487− self.renderer.surface.reset(); // reset is faster than allocating new empty surface
488 let mut cx = crate::compositor::Context {
481 let mut cx = crate::compositor::Context {
489 editor: &mut self.editor,
482 editor: &mut self.editor,
490 executor: &self.executor,
483 executor: &self.executor,
@@ -543,6 +536,7 @@ impl<'a> Application<'a> {
544 if should_redraw {
537 if should_redraw {
545 self.render();
538 self.render();
539+ // calling render twice here fixes it for some reason