aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-17 16:22:16 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-17 16:22:16 +0000
commit04cbee7593747dd7c25565a7083152d3e2b739e0 (patch)
tree5f1dd109209f11aaf1c7cca8a772f6df558dc070
parentcsi: implement 'CHT' - Cursor Horizontal Tab (diff)
Revert "vt: replace pre_print() with term_autowrap()"
This reverts commit fd8a3992745b9ec51b6e6c1dfc39faf01369b680.
-rw-r--r--vt.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/vt.c b/vt.c
index 0257879b..bcce4052 100644
--- a/vt.c
+++ b/vt.c
@@ -713,6 +713,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)
{
if (term->cursor.point.col < term->cols - 1)
@@ -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];