fix something- possibly terminal size change
parent
1f3b1dde50
commit
b24b7f81d1
|
@ -1,7 +1,7 @@
|
|||
use crossterm::{
|
||||
cursor, queue,
|
||||
style::{self, Stylize},
|
||||
terminal::{size, Clear, ClearType},
|
||||
terminal::{self, size, Clear, ClearType},
|
||||
ExecutableCommand, QueueableCommand, Result as CTRes,
|
||||
};
|
||||
use std::{
|
||||
|
@ -96,6 +96,7 @@ impl<'a, T: Data> Window<T> {
|
|||
self.root_widget.update(&self.data);
|
||||
let terminal_size = size()?;
|
||||
if self.data.changed() || self.size != terminal_size.into() {
|
||||
self.size = terminal_size.into();
|
||||
queue![self.out, Clear(ClearType::All)]?;
|
||||
self.out.flush()?;
|
||||
self.buf = vec![' '; terminal_size.0 as usize * terminal_size.1 as usize];
|
||||
|
|
Loading…
Reference in New Issue