aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-06-09 06:46:13 +0000
committerBlaž Hrastnik2021-08-10 01:52:52 +0000
commit0a7add4ad4b0f9838e585b12d8d07f8ed637eb97 (patch)
tree450e87edf959485d6fe75e9b324a4e258deea5c4
parent815ee9e334da0b973510e1b956eb75fe437038da (diff)
Only recalculate resize during rendering, this stops flashing on resize
-rw-r--r--helix-term/src/ui/editor.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index ffe755e6..3fcd6921 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -698,9 +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.saturating_sub(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) => {