aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-14 09:25:06 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-14 09:25:06 +0000
commitb8c7dfba5c3fd6a2bd0ac28663c0c5d55ee2ed4a (patch)
tree11d86d414a3e0b30770c9f614ccb009008e866b0
parentgrid: reflow: force line-wrap if a multi-column character does not fit on current line (diff)
term: line-wrap: manually set cursor row+col
line-wrap is in the hot path, and term_cursor_down/left adds additional checks that we don't need.
-rw-r--r--terminal.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/terminal.c b/terminal.c
index 76318d90..99ef16d7 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2354,11 +2354,15 @@ print_linewrap(struct terminal *term)
return;
}
+ term->grid->cursor.lcf = false;
if (term->grid->cursor.point.row == term->scroll_region.end - 1)
term_scroll(term, 1);
- else
- term_cursor_down(term, 1);
- term_cursor_left(term, term->grid->cursor.point.col);
+ else {
+ assert(term->grid->cursor.point.row < term->scroll_region.end - 1);
+ term->grid->cursor.point.row++;
+ }
+
+ term->grid->cursor.point.col = 0;
}
static inline void