statusbar: don't overwrite num buffer when progress spinner is deactivated

This commit is contained in:
Manos Pitsidianakis 2020-10-20 15:04:50 +03:00
parent 91fe7435f7
commit 126ed8a189
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

View File

@ -154,13 +154,6 @@ impl StatusBar {
if self.progress_spinner.is_active() {
x = x.saturating_sub(1 + self.progress_spinner.width);
}
for (idx, c) in self.display_buffer.chars().rev().enumerate() {
if let Some(cell) = grid.get_mut(x.saturating_sub(idx).saturating_sub(1), y) {
cell.set_ch(c);
} else {
break;
}
}
if self.progress_spinner.is_dirty() {
self.progress_spinner.draw(
grid,
@ -171,6 +164,13 @@ impl StatusBar {
context,
);
}
for (idx, c) in self.display_buffer.chars().rev().enumerate() {
if let Some(cell) = grid.get_mut(x.saturating_sub(idx).saturating_sub(1), y) {
cell.set_ch(c);
} else {
break;
}
}
context.dirty_areas.push_back(area);
}