aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-12-12 11:18:44 +0000
committerBlaž Hrastnik2020-12-12 11:18:44 +0000
commit29cb33300b1486c778e9318e87e60c26695c2520 (patch)
tree75ba71788297ef4b55e6d66cb14eb55cc9bae576 /helix-term/src
parentada3f92c5b96e4c66f5647c4ac2487f3903692b3 (diff)
wip
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/application.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 35d698d1..589aaf6e 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -336,6 +336,7 @@ impl Renderer {
.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 @@ impl Component for EditorView {
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 @@ impl<'a> Application<'a> {
}
fn render(&mut self) {
- self.renderer.surface.reset(); // reset is faster than allocating new empty surface
let mut cx = crate::compositor::Context {
editor: &mut self.editor,
executor: &self.executor,
@@ -543,6 +536,7 @@ impl<'a> Application<'a> {
if should_redraw {
self.render();
+ // calling render twice here fixes it for some reason
}
}