From 3d86951928b09c85a013b2be6c74aec2c7cdf285 2010-08-27 16:05:24 From: epatters Date: 2010-08-27 16:05:24 Subject: [PATCH] Added comment explaining why the behavior of Ctrl-L cannot be improved, after trying and failing to do so. --- diff --git a/IPython/frontend/qt/console/console_widget.py b/IPython/frontend/qt/console/console_widget.py index ab24f11..d09bd3d 100644 --- a/IPython/frontend/qt/console/console_widget.py +++ b/IPython/frontend/qt/console/console_widget.py @@ -643,6 +643,13 @@ class ConsoleWidget(Configurable, QtGui.QWidget): intercepted = True elif key == QtCore.Qt.Key_L: + # It would be better to simply move the prompt block to the top + # of the control viewport. QPlainTextEdit has a private method + # to do this (setTopBlock), but it cannot be duplicated here + # because it requires access to the QTextControl that underlies + # both QPlainTextEdit and QTextEdit. In short, this can only be + # achieved by appending newlines after the prompt, which is a + # gigantic hack and likely to cause other problems. self.clear() intercepted = True