about summary refs log tree commit diff stats
path: root/termbox/termbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'termbox/termbox.c')
-rw-r--r--termbox/termbox.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/termbox/termbox.c b/termbox/termbox.c
index c9ea6012..76d43753 100644
--- a/termbox/termbox.c
+++ b/termbox/termbox.c
@@ -181,6 +181,10 @@ void tb_present(void)
       front = &CELL(&front_buffer, x, y);
       w = wcwidth(back->ch);
       if (w < 1) w = 1;
+      if (memcmp(back, front, sizeof(struct tb_cell)) == 0) {
+        x += w;
+        continue;
+      }
       memcpy(front, back, sizeof(struct tb_cell));
       send_attr(back->fg, back->bg);
       if (w > 1 && x >= front_buffer.width - (w - 1)) {
@@ -205,6 +209,11 @@ void tb_present(void)
   bytebuffer_flush(&output_buffer, inout);
 }
 
+void tb_sync(void) {
+  cellbuf_clear(&front_buffer);
+  tb_present();
+}
+
 void tb_set_cursor(int cx, int cy)
 {
   assert(termw != -1);