##// END OF EJS Templates
Clearing the ConsoleWidget now cancels reading, which is the intuitive behavior.
epatters -
Show More
@@ -267,7 +267,6 b' class ConsoleWidget(QtGui.QPlainTextEdit):'
267 self._reading = False
267 self._reading = False
268 if self._reading_callback:
268 if self._reading_callback:
269 self._reading_callback()
269 self._reading_callback()
270 self._reading_callback = None
271 elif not self._executing:
270 elif not self._executing:
272 self.execute(interactive=True)
271 self.execute(interactive=True)
273 intercepted = True
272 intercepted = True
@@ -366,16 +365,19 b' class ConsoleWidget(QtGui.QPlainTextEdit):'
366 cursor.insertText(text)
365 cursor.insertText(text)
367
366
368 def clear(self, keep_input=False):
367 def clear(self, keep_input=False):
369 """ Reimplemented to write a new prompt. If 'keep_input' is set,
368 """ Reimplemented to cancel reading and write a new prompt. If
370 restores the old input buffer when the new prompt is written.
369 'keep_input' is set, restores the old input buffer when the new
370 prompt is written.
371 """
371 """
372 super(ConsoleWidget, self).clear()
372 super(ConsoleWidget, self).clear()
373
373
374 if keep_input:
374 input_buffer = ''
375 if self._reading:
376 self._reading = False
377 elif keep_input:
375 input_buffer = self.input_buffer
378 input_buffer = self.input_buffer
376 self._show_prompt()
379 self._show_prompt()
377 if keep_input:
380 self.input_buffer = input_buffer
378 self.input_buffer = input_buffer
379
381
380 def paste(self):
382 def paste(self):
381 """ Reimplemented to ensure that text is pasted in the editing region.
383 """ Reimplemented to ensure that text is pasted in the editing region.
General Comments 0
You need to be logged in to leave comments. Login now