diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-11-20 13:39:32 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-11-21 17:09:27 +0000 |
| commit | 53fc1a1cb12fc2367a1ff76e723be52603c39cdc (patch) | |
| tree | 462ae887cf61c575d4fc918e10ab79d9b54fa9bd | |
| parent | term: 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.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 |
