From d3b8bcb62a5124d5ea0d6e3fcfb3d6cf0e3afb63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Fri, 13 Apr 2018 11:36:30 +0200 Subject: [PATCH] Fix blank lines when scrolling up Hexdump --- src/widgets/HexdumpWidget.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/widgets/HexdumpWidget.cpp b/src/widgets/HexdumpWidget.cpp index 3e65b3a8..ead2dd08 100644 --- a/src/widgets/HexdumpWidget.cpp +++ b/src/widgets/HexdumpWidget.cpp @@ -779,12 +779,11 @@ void HexdumpWidget::removeTopLinesWithoutScroll(QTextEdit *textEdit, int lines) int height_before = textEdit->document()->size().height(); QTextBlock block = textEdit->document()->firstBlock(); - QTextCursor textCursor = textEdit->textCursor(); for (int i = 0; i < lines; i++) { QTextCursor cursor(block); - cursor.select(QTextCursor::BlockUnderCursor); - cursor.removeSelectedText(); block = block.next(); + cursor.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor); + cursor.removeSelectedText(); } int height_after = textEdit->document()->size().height();