mirror of
https://github.com/ClementTsang/bottom
synced 2024-11-22 20:23:12 +00:00
other: don't draw on non-updating events (#924)
This commit is contained in:
parent
5cce30c7f1
commit
d3577bd1ab
1 changed files with 4 additions and 3 deletions
|
@ -162,14 +162,17 @@ fn main() -> Result<()> {
|
|||
break;
|
||||
}
|
||||
update_data(&mut app);
|
||||
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||
}
|
||||
BottomEvent::MouseInput(event) => {
|
||||
handle_mouse_event(event, &mut app);
|
||||
update_data(&mut app);
|
||||
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||
}
|
||||
BottomEvent::PasteEvent(paste) => {
|
||||
app.handle_paste(paste);
|
||||
update_data(&mut app);
|
||||
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||
}
|
||||
BottomEvent::Update(data) => {
|
||||
app.data_collection.eat_data(data);
|
||||
|
@ -278,6 +281,7 @@ fn main() -> Result<()> {
|
|||
}
|
||||
|
||||
update_data(&mut app);
|
||||
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||
}
|
||||
}
|
||||
BottomEvent::Clean => {
|
||||
|
@ -286,9 +290,6 @@ fn main() -> Result<()> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: [OPT] Should not draw if no change (ie: scroll max)
|
||||
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||
}
|
||||
|
||||
// I think doing it in this order is safe...
|
||||
|
|
Loading…
Reference in a new issue