From 04cbee7593747dd7c25565a7083152d3e2b739e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 17 Nov 2019 17:22:16 +0100 Subject: [PATCH] Revert "vt: replace pre_print() with term_autowrap()" This reverts commit fd8a3992745b9ec51b6e6c1dfc39faf01369b680. --- vt.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/vt.c b/vt.c index 0257879b..bcce4052 100644 --- a/vt.c +++ b/vt.c @@ -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];