From 4d4d70d616be3ab6a536711cff0911c6c1b25350 Mon Sep 17 00:00:00 2001 From: Carlos Alves Date: Fri, 13 Nov 2020 17:25:42 -0300 Subject: [PATCH] Ignore current cursor line Don't need to reflow the current cursor line. (it will bug and crash) --- src/Screen.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Screen.cpp b/src/Screen.cpp index 42a125f6..2716b37e 100644 --- a/src/Screen.cpp +++ b/src/Screen.cpp @@ -408,15 +408,11 @@ void Screen::resizeImage(int new_lines, int new_columns) // Then move the data to lines below. currentPos = 0; - while (currentPos != _screenLines.count()) { + while (currentPos != _screenLines.count() && currentPos != _cuY) { const bool shouldCopy = _screenLines[currentPos].size() > new_columns; // Copy from the current line, to the next one. if (shouldCopy) { - // If we are in the last line, append a new one. - if (currentPos == _screenLines.count() - 1) { - _screenLines.append(ImageLine{}); - } _cuY++; auto values = _screenLines[currentPos].mid(new_columns);