##// END OF EJS Templates
* Fixed history breakage due to recent refactoring....
epatters -
Show More
@@ -406,6 +406,12 b' class ConsoleWidget(QtGui.QPlainTextEdit):'
406 entered by the user. The effect of this parameter depends on the
406 entered by the user. The effect of this parameter depends on the
407 subclass implementation.
407 subclass implementation.
408
408
409 Raises:
410 -------
411 RuntimeError
412 If incomplete input is given and 'hidden' is True. In this case,
413 it not possible to prompt for more input.
414
409 Returns:
415 Returns:
410 --------
416 --------
411 A boolean indicating whether the source was executed.
417 A boolean indicating whether the source was executed.
@@ -751,14 +757,14 b' class HistoryConsoleWidget(ConsoleWidget):'
751 def execute(self, source=None, hidden=False, interactive=False):
757 def execute(self, source=None, hidden=False, interactive=False):
752 """ Reimplemented to the store history.
758 """ Reimplemented to the store history.
753 """
759 """
754 if source is None and not hidden:
760 if not hidden:
755 history = self.input_buffer.rstrip()
761 history = self.input_buffer if source is None else source
756
762
757 executed = super(HistoryConsoleWidget, self).execute(
763 executed = super(HistoryConsoleWidget, self).execute(
758 source, hidden, interactive)
764 source, hidden, interactive)
759
765
760 if executed and not hidden:
766 if executed and not hidden:
761 self._history.append(history)
767 self._history.append(history.rstrip())
762 self._history_index = len(self._history)
768 self._history_index = len(self._history)
763
769
764 return executed
770 return executed
@@ -103,5 +103,3 b" if __name__ == '__main__':"
103 widget.resize(640, 480)
103 widget.resize(640, 480)
104 widget.show()
104 widget.show()
105 app.exec_()
105 app.exec_()
106
107
General Comments 0
You need to be logged in to leave comments. Login now