mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-22 09:26:19 +04:00
Only recalculate resize during rendering, this stops flashing on resize
This commit is contained in:
parent
8ac2d50fec
commit
b9ff4bde2a
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user