aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-11-20 13:39:32 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-11-21 17:09:27 +0000
commit53fc1a1cb12fc2367a1ff76e723be52603c39cdc (patch)
tree462ae887cf61c575d4fc918e10ab79d9b54fa9bd
parentterm: call grid_row_uri_range_erase() when printing cells (diff)
term: tail-call optimize calls to grid_row_uri_range_erase()
-rw-r--r--terminal.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/terminal.c b/terminal.c
index 7bf912e8..120f7ac3 100644
--- a/terminal.c
+++ b/terminal.c
@@ -3209,7 +3209,7 @@ term_print(struct terminal *term, wchar_t wc, int width)
row->dirty = true;
row->linebreak = true;
- grid_row_uri_range_erase(row, col, col + width - 1);
+ int uri_start = col;
/* Advance cursor the 'additional' columns while dirty:ing the cells */
for (int i = 1; i < width && col < term->cols - 1; i++) {
@@ -3225,6 +3225,9 @@ term_print(struct terminal *term, wchar_t wc, int width)
xassert(!grid->cursor.lcf);
grid->cursor.point.col = col;
+
+ if (unlikely(row->extra != NULL))
+ grid_row_uri_range_erase(row, uri_start, uri_start + width - 1);
}
static void
@@ -3255,7 +3258,7 @@ ascii_printer_fast(struct terminal *term, wchar_t wc)
row->dirty = true;
row->linebreak = true;
- grid_row_uri_range_erase(row, col, col);
+ int uri_start = col;
/* Advance cursor */
if (unlikely(++col >= term->cols)) {
@@ -3265,6 +3268,9 @@ ascii_printer_fast(struct terminal *term, wchar_t wc)
xassert(!grid->cursor.lcf);
grid->cursor.point.col = col;
+
+ if (unlikely(row->extra != NULL))
+ grid_row_uri_range_erase(row, uri_start, uri_start);
}
static void