From c96d5ebef7518d161107724ecaff80b7cc7ea530 Mon Sep 17 00:00:00 2001 From: Loren Eteval Date: Sat, 11 Nov 2023 11:03:09 +0800 Subject: [PATCH] Fix log truncation bug if user cursor is present Signed-off-by: Loren Eteval --- Furious/Widget/LogViewer.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Furious/Widget/LogViewer.py b/Furious/Widget/LogViewer.py index 3076e8f..3b9b85e 100644 --- a/Furious/Widget/LogViewer.py +++ b/Furious/Widget/LogViewer.py @@ -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