From 5c37589e399051dbd4d241721c62b03f23fb93bc Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Wed, 5 Aug 2015 22:57:01 +0200 Subject: [PATCH] fix resize when cursor alone on last line --- src/bin/termpty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/termpty.c b/src/bin/termpty.c index a273ebbf..18451724 100644 --- a/src/bin/termpty.c +++ b/src/bin/termpty.c @@ -996,7 +996,8 @@ termpty_resize(Termpty *ty, int new_w, int new_h) for (old_y = old_h -1; old_y >= 0; old_y--) { Termcell *cells = &TERMPTY_SCREEN(ty, 0, old_y); - if (!termpty_line_is_empty(cells, old_w)) + if (!termpty_line_is_empty(cells, old_w) && + ty->cursor_state.cy < old_y) { effective_old_h = old_y + 1; break;