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.
This commit is contained in:
Daniel Eklöf 2020-07-14 11:25:06 +02:00
parent 803c87bb65
commit b8c7dfba5c
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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