Skip to content

Commit

Permalink
Only skip unchanged chars on persistent backends
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Jun 10, 2024
1 parent 2a7b368 commit a4f8d93
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cursive-core/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ impl PrintBuffer {
pub fn flush(&mut self, backend: &dyn Backend) {
let terminal_width = self.size.x;

let persistent = backend.is_persistent();

let mut current_pos = Vec2::zero();
backend.move_to(current_pos);

Expand All @@ -279,7 +281,7 @@ impl PrintBuffer {
.zip(self.frozen_buffer.iter())
.enumerate()
{
if active == frozen {
if persistent && active == frozen {
// TODO (optim): it may be pricier to omit printing a letter but to then "move to" the
// cell to the right. So there should be a price N for the jump, and wait until we see
// N bytes without changes to actually jump. If it changes before that, flush the
Expand Down

0 comments on commit a4f8d93

Please sign in to comment.