From bbce760ab001960e684d799af01c47405a387863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 14 Jul 2020 10:08:57 +0200 Subject: [PATCH] term: line-wrap: use term_cursor_{down,left} --- terminal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/terminal.c b/terminal.c index 071c5cf9..e02255bc 100644 --- a/terminal.c +++ b/terminal.c @@ -2352,11 +2352,11 @@ print_linewrap(struct terminal *term) return; } - if (term->grid->cursor.point.row == term->scroll_region.end - 1) { + if (term->grid->cursor.point.row == term->scroll_region.end - 1) term_scroll(term, 1); - term_cursor_to(term, term->grid->cursor.point.row, 0); - } else - term_cursor_to(term, min(term->grid->cursor.point.row + 1, term->rows - 1), 0); + else + term_cursor_down(term, 1); + term_cursor_left(term, term->grid->cursor.point.col); } static inline void