##// END OF EJS Templates
The ConsoleWidget now only pages text if it exceeds the height of the visible window.
epatters -
Show More
@@ -1,4 +1,5 b''
1 1 # Standard library imports
2 import re
2 3 import sys
3 4 from textwrap import dedent
4 5
@@ -994,12 +995,17 b' class ConsoleWidget(QtGui.QWidget):'
994 995 return True
995 996
996 997 def _page(self, text):
997 """ Displays text using the pager.
998 """ Displays text using the pager if it exceeds the height of the
999 visible area.
998 1000 """
1001 if self._page_style == 'none':
1002 self._append_plain_text(text)
1003 else:
1004 line_height = QtGui.QFontMetrics(self.font).height()
1005 minlines = self._control.viewport().height() / line_height
1006 if re.match("(?:[^\n]*\n){%i}" % minlines, text):
999 1007 if self._page_style == 'custom':
1000 1008 self.custom_page_requested.emit(text)
1001 elif self._page_style == 'none':
1002 self._append_plain_text(text)
1003 1009 else:
1004 1010 self._page_control.clear()
1005 1011 cursor = self._page_control.textCursor()
@@ -1012,6 +1018,8 b' class ConsoleWidget(QtGui.QWidget):'
1012 1018 self._page_control.setFocus()
1013 1019 else:
1014 1020 self.layout().setCurrentWidget(self._page_control)
1021 else:
1022 self._append_plain_text(text)
1015 1023
1016 1024 def _prompt_started(self):
1017 1025 """ Called immediately after a new prompt is displayed.
General Comments 0
You need to be logged in to leave comments. Login now