Revert "vt: replace pre_print() with term_autowrap()"

This reverts commit fd8a399274.
This commit is contained in:
Daniel Eklöf 2019-11-17 17:22:16 +01:00
parent 7f4b2c5755
commit 04cbee7593
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

16
vt.c
View file

@ -712,6 +712,18 @@ esc_dispatch(struct terminal *term, uint8_t final)
}
}
static inline void
pre_print(struct terminal *term)
{
if (unlikely(term->cursor.lcf) && term->auto_margin) {
if (term->cursor.point.row == term->scroll_region.end - 1) {
term_scroll(term, 1);
term_cursor_to(term, term->cursor.point.row, 0);
} else
term_cursor_to(term, term->cursor.point.row + 1, 0);
}
}
static inline void
post_print(struct terminal *term)
{
@ -742,7 +754,7 @@ print_insert(struct terminal *term, int width)
static void
action_print_utf8(struct terminal *term)
{
term_autowrap(term);
pre_print(term);
struct row *row = term->grid->cur_row;
struct cell *cell = &row->cells[term->cursor.point.col];
@ -786,7 +798,7 @@ action_print_utf8(struct terminal *term)
static void
action_print(struct terminal *term, uint8_t c)
{
term_autowrap(term);
pre_print(term);
struct row *row = term->grid->cur_row;
struct cell *cell = &row->cells[term->cursor.point.col];