mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-22 21:24:49 +02:00
other: don't draw on non-updating events (#924)
This commit is contained in:
parent
5cce30c7f1
commit
d3577bd1ab
@ -162,14 +162,17 @@ fn main() -> Result<()> {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
update_data(&mut app);
|
update_data(&mut app);
|
||||||
|
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||||
}
|
}
|
||||||
BottomEvent::MouseInput(event) => {
|
BottomEvent::MouseInput(event) => {
|
||||||
handle_mouse_event(event, &mut app);
|
handle_mouse_event(event, &mut app);
|
||||||
update_data(&mut app);
|
update_data(&mut app);
|
||||||
|
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||||
}
|
}
|
||||||
BottomEvent::PasteEvent(paste) => {
|
BottomEvent::PasteEvent(paste) => {
|
||||||
app.handle_paste(paste);
|
app.handle_paste(paste);
|
||||||
update_data(&mut app);
|
update_data(&mut app);
|
||||||
|
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||||
}
|
}
|
||||||
BottomEvent::Update(data) => {
|
BottomEvent::Update(data) => {
|
||||||
app.data_collection.eat_data(data);
|
app.data_collection.eat_data(data);
|
||||||
@ -278,6 +281,7 @@ fn main() -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
update_data(&mut app);
|
update_data(&mut app);
|
||||||
|
try_drawing(&mut terminal, &mut app, &mut painter)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BottomEvent::Clean => {
|
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...
|
// I think doing it in this order is safe...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user