mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-19 10:58:51 +00:00
Fix blank lines when scrolling up Hexdump
This commit is contained in:
parent
2af51a1af0
commit
d3b8bcb62a
@ -779,12 +779,11 @@ void HexdumpWidget::removeTopLinesWithoutScroll(QTextEdit *textEdit, int lines)
|
|||||||
int height_before = textEdit->document()->size().height();
|
int height_before = textEdit->document()->size().height();
|
||||||
|
|
||||||
QTextBlock block = textEdit->document()->firstBlock();
|
QTextBlock block = textEdit->document()->firstBlock();
|
||||||
QTextCursor textCursor = textEdit->textCursor();
|
|
||||||
for (int i = 0; i < lines; i++) {
|
for (int i = 0; i < lines; i++) {
|
||||||
QTextCursor cursor(block);
|
QTextCursor cursor(block);
|
||||||
cursor.select(QTextCursor::BlockUnderCursor);
|
|
||||||
cursor.removeSelectedText();
|
|
||||||
block = block.next();
|
block = block.next();
|
||||||
|
cursor.movePosition(QTextCursor::NextBlock, QTextCursor::KeepAnchor);
|
||||||
|
cursor.removeSelectedText();
|
||||||
}
|
}
|
||||||
|
|
||||||
int height_after = textEdit->document()->size().height();
|
int height_after = textEdit->document()->size().height();
|
||||||
|
Loading…
Reference in New Issue
Block a user