Fix log truncation bug if user cursor is present

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2023-11-11 11:03:09 +08:00
parent a5349a5876
commit c96d5ebef7
+2 -6
View File
@@ -281,12 +281,8 @@ class LogViewerWidget(MainWindow):
vScrollBar = textBrowser.verticalScrollBar()
scrollEnds = vScrollBar.maximum() - vScrollBar.value() <= 10
if line.endswith('\n'):
textBrowser.insertPlainText(line)
else:
textBrowser.append(line)
APP().processEvents()
# Fix insertPlainText bug if user cursor is present
textBrowser.append(line.rstrip())
if scrollEnds:
vScrollBar.setValue(vScrollBar.maximum()) # Scrolls to the bottom