From b9ff4bde2ab9f8e956f9d67e1f408f34a473dde7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Wed, 9 Jun 2021 15:46:13 +0900 Subject: [PATCH] Only recalculate resize during rendering, this stops flashing on resize --- helix-term/src/ui/editor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index a2b169ed4..1f10c8dc0 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -698,8 +698,8 @@ impl Component for EditorView { fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult { match event { Event::Resize(width, height) => { - // HAXX: offset the render area height by 1 to account for prompt/commandline - cx.editor.resize(Rect::new(0, 0, width, height - 1)); + // Ignore this event, we handle resizing just before rendering to screen. + // Handling it here but not re-rendering will cause flashing EventResult::Consumed(None) } Event::Key(key) => {