Show More
@@ -340,9 +340,13 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||
|
340 | 340 | cursor.beginEditBlock() |
|
341 | 341 | cursor.insertText('\n') |
|
342 | 342 | self._insert_continuation_prompt(cursor) |
|
343 | self._control.moveCursor(QtGui.QTextCursor.End) | |
|
344 | 343 | cursor.endEditBlock() |
|
345 | 344 | |
|
345 | # Do not do this inside the edit block. It works as expected | |
|
346 | # when using a QPlainTextEdit control, but does not have an | |
|
347 | # effect when using a QTextEdit. I believe this is a Qt bug. | |
|
348 | self._control.moveCursor(QtGui.QTextCursor.End) | |
|
349 | ||
|
346 | 350 | return complete |
|
347 | 351 | |
|
348 | 352 | def _get_input_buffer(self): |
@@ -714,10 +718,12 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||
|
714 | 718 | if cursor.selectedText().trimmed().isEmpty(): |
|
715 | 719 | self.execute(interactive=True) |
|
716 | 720 | else: |
|
721 | # Do this inside an edit block for clean undo/redo. | |
|
717 | 722 | cursor.beginEditBlock() |
|
718 | 723 | cursor.setPosition(position) |
|
719 | 724 | cursor.insertText('\n') |
|
720 | 725 | self._insert_continuation_prompt(cursor) |
|
726 | cursor.endEditBlock() | |
|
721 | 727 | |
|
722 | 728 | # Ensure that the whole input buffer is visible. |
|
723 | 729 | # FIXME: This will not be usable if the input buffer |
@@ -725,8 +731,6 b' class ConsoleWidget(Configurable, QtGui.QWidget):' | |||
|
725 | 731 | self._control.moveCursor(QtGui.QTextCursor.End) |
|
726 | 732 | self._control.setTextCursor(cursor) |
|
727 | 733 | |
|
728 | cursor.endEditBlock() | |
|
729 | ||
|
730 | 734 | elif key == QtCore.Qt.Key_Up: |
|
731 | 735 | if self._reading or not self._up_pressed(): |
|
732 | 736 | intercepted = True |
@@ -176,7 +176,7 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):' | |||
|
176 | 176 | if self._control_key_down(event.modifiers()): |
|
177 | 177 | if key == QtCore.Qt.Key_C and self._executing: |
|
178 | 178 | self.interrupt_kernel() |
|
179 |
return True |
|
|
179 | return True | |
|
180 | 180 | elif key == QtCore.Qt.Key_Period: |
|
181 | 181 | message = 'Are you sure you want to restart the kernel?' |
|
182 | 182 | self.restart_kernel(message) |
General Comments 0
You need to be logged in to leave comments.
Login now