diff --git a/src/engine.rs b/src/engine.rs index c3427673..21595214 100644 --- a/src/engine.rs +++ b/src/engine.rs @@ -718,6 +718,13 @@ impl Reedline { let mut latest_resize = None; loop { + // There could be multiple events queued up! + // pasting text, resizes, blocking this thread (e.g. during debugging) + // We should be able to handle all of them as quickly as possible without causing unnecessary output steps. + if !event::poll(Duration::from_millis(POLL_WAIT))? { + break; + } + match event::read()? { Event::Resize(x, y) => { latest_resize = Some((x, y)); @@ -746,13 +753,6 @@ impl Reedline { } } } - - // There could be multiple events queued up! - // pasting text, resizes, blocking this thread (e.g. during debugging) - // We should be able to handle all of them as quickly as possible without causing unnecessary output steps. - if !event::poll(Duration::from_millis(POLL_WAIT))? { - break; - } } if let Some((x, y)) = latest_resize {