From 26d016b219d5418023bb5639753b5b3e17f35739 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 8 Oct 2014 21:54:25 +0200 Subject: [PATCH] debug-console: Move cursor to end before inserting text. Fixes #162. --- qutebrowser/widgets/console.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qutebrowser/widgets/console.py b/qutebrowser/widgets/console.py index fb7006477..f42eabe69 100644 --- a/qutebrowser/widgets/console.py +++ b/qutebrowser/widgets/console.py @@ -24,6 +24,7 @@ import code from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt from PyQt5.QtWidgets import QTextEdit, QWidget, QVBoxLayout, QApplication +from PyQt5.QtGui import QTextCursor from qutebrowser.config import config from qutebrowser.models import cmdhistory @@ -197,6 +198,7 @@ class ConsoleWidget(QWidget): def insert_text(self, text): """Insert new text and scroll output to bottom.""" + self._output.moveCursor(QTextCursor.End) self._output.insertPlainText(text) scrollbar = self._output.verticalScrollBar() scrollbar.setValue(scrollbar.maximum())