on master help sign in
Only recalculate resize during rendering, this stops flashing on resize
commit0a7add4ad4b0f9838e585b12d8d07f8ed637eb97 authorBlaž Hrastnik <blaz@mxxn.io> dateWed 9 Jun 2021, 15:46 (5 years ago) parent815ee9e
1 file changed+2−3
helix-term/src/ui/editor.rs+2−3
helix-term/src/ui/editor.rs+2−3
@@ -698,9 +698,8 @@ impl Component for EditorView {
698698 fn handle_event(&mut self, event: Event, cx: &mut Context) -> EventResult {
699699 match event {
700700 Event::Resize(width, height) => {
701− // HAXX: offset the render area height by 1 to account for prompt/commandline
702− cx.editor
703− .resize(Rect::new(0, 0, width, height.saturating_sub(1)));
701+ // Ignore this event, we handle resizing just before rendering to screen.
702+ // Handling it here but not re-rendering will cause flashing
704703 EventResult::Consumed(None)
705704 }
706705 Event::Key(key) => {