##// END OF EJS Templates
qtconsole: Create a prompt newline by inserting a new block (w/o formatting)...
Bradley M. Froehle -
Show More
@@ -858,6 +858,11 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
858
858
859 return result
859 return result
860
860
861 def _append_block(self, block_format=None, before_prompt=False):
862 """ Appends an new QTextBlock to the end of the console buffer.
863 """
864 self._append_custom(self._insert_block, block_format, before_prompt)
865
861 def _append_html(self, html, before_prompt=False):
866 def _append_html(self, html, before_prompt=False):
862 """ Appends HTML at the end of the console buffer.
867 """ Appends HTML at the end of the console buffer.
863 """
868 """
@@ -1545,6 +1550,13 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
1545 self._continuation_prompt = self._insert_html_fetching_plain_text(
1550 self._continuation_prompt = self._insert_html_fetching_plain_text(
1546 cursor, self._continuation_prompt_html)
1551 cursor, self._continuation_prompt_html)
1547
1552
1553 def _insert_block(self, cursor, block_format=None):
1554 """ Inserts an empty QTextBlock using the specified cursor.
1555 """
1556 if block_format is None:
1557 block_format = QtGui.QTextBlockFormat()
1558 cursor.insertBlock(block_format)
1559
1548 def _insert_html(self, cursor, html):
1560 def _insert_html(self, cursor, html):
1549 """ Inserts HTML using the specified cursor in such a way that future
1561 """ Inserts HTML using the specified cursor in such a way that future
1550 formatting is unaffected.
1562 formatting is unaffected.
@@ -1866,7 +1878,7 b' class ConsoleWidget(LoggingConfigurable, QtGui.QWidget):'
1866 cursor.movePosition(QtGui.QTextCursor.Left,
1878 cursor.movePosition(QtGui.QTextCursor.Left,
1867 QtGui.QTextCursor.KeepAnchor)
1879 QtGui.QTextCursor.KeepAnchor)
1868 if cursor.selection().toPlainText() != '\n':
1880 if cursor.selection().toPlainText() != '\n':
1869 self._append_plain_text('\n')
1881 self._append_block()
1870
1882
1871 # Write the prompt.
1883 # Write the prompt.
1872 self._append_plain_text(self._prompt_sep)
1884 self._append_plain_text(self._prompt_sep)
General Comments 0
You need to be logged in to leave comments. Login now