aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-03-16 07:44:25 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-03-16 07:44:25 +0000
commitd8f0e701b5ce0190bba84bc3d9e151ced420562b (patch)
treed7d6b1b6c5a1871e961a11e5ab0661f003f57c19
parentsixel: sixel_overwrite_at_cursor(): early exit when the image list is empty (diff)
parentterm: term_print(): assume we’re *not* at the right margin (diff)
Merge branch 'term-print-assume-col-can-be-incremented'
-rw-r--r--terminal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/terminal.c b/terminal.c
index 88599094..85f267e1 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2848,11 +2848,11 @@ term_print(struct terminal *term, wchar_t wc, int width)
}
/* Advance cursor */
- if (term->grid->cursor.point.col < term->cols - 1) {
- term->grid->cursor.point.col++;
- xassert(!term->grid->cursor.lcf);
- } else
+ if (unlikely(++term->grid->cursor.point.col >= term->cols)) {
term->grid->cursor.lcf = true;
+ term->grid->cursor.point.col--;
+ } else
+ xassert(!term->grid->cursor.lcf);
}
enum term_surface