From d0264c347f210cc17796438600e1bc3a623e5ee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Popadi=C4=87?= Date: Sat, 15 Mar 2014 18:19:22 +0100 Subject: [PATCH] Fix disappearing prompt on resize ...and break reflow of multiline prompt lines. --- src/bin/termpty.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/src/bin/termpty.c b/src/bin/termpty.c index 21f6a531..71d47a68 100644 --- a/src/bin/termpty.c +++ b/src/bin/termpty.c @@ -768,23 +768,7 @@ termpty_resize(Termpty *ty, int new_w, int new_h) new_back = calloc(sizeof(Termsave *), ty->backmax); y_end = ty->state.cy; - y_start = termpty_line_find_top(ty, y_end); - if (ty->w == 1) - { - new_y_start = new_h - 1; - new_y_end = new_y_start - 1; - } - else - { - new_y_start = new_h - 1 - (y_end - y_start); - new_y_end = new_y_start - 1; - if (new_y_end < 0) - { - new_y_start = 0; - new_y_end = -1; - } - } - y_end = y_start - 1; + new_y_end = new_h - 1; while ((y_end >= -ty->backscroll_num) && (new_y_end >= -ty->backmax)) { y_start = termpty_line_find_top(ty, y_end); @@ -802,6 +786,8 @@ termpty_resize(Termpty *ty, int new_w, int new_h) ty->w = new_w; ty->h = new_h; ty->state.cy = MIN((new_h - 1) - new_y_start, new_h - 1); + ty->state.cx = termpty_line_length(new_screen + ((new_h - 1) * new_w), + new_w); ty->circular_offset = MAX(new_y_start, 0); ty->backpos = 0; ty->backscroll_num = MAX(-new_y_start, 0);