From efad06b0cdb51a47ac3236cd84af9eab0a13287a 2010-08-09 15:41:09 From: epatters Date: 2010-08-09 15:41:09 Subject: [PATCH] Minor cleanup related to tab widths. --- diff --git a/IPython/frontend/qt/console/console_widget.py b/IPython/frontend/qt/console/console_widget.py index 87dcafb..a5bba3b 100644 --- a/IPython/frontend/qt/console/console_widget.py +++ b/IPython/frontend/qt/console/console_widget.py @@ -30,7 +30,7 @@ class ConsoleWidget(QtGui.QPlainTextEdit): override_shortcuts = False # The number of spaces to show for a tab character. - tab_width = 4 + tab_width = 8 # Protected class variables. _ctrl_down_remap = { QtCore.Qt.Key_B : QtCore.Qt.Key_Left, diff --git a/IPython/frontend/qt/console/frontend_widget.py b/IPython/frontend/qt/console/frontend_widget.py index c33dc58..f94721d 100644 --- a/IPython/frontend/qt/console/frontend_widget.py +++ b/IPython/frontend/qt/console/frontend_widget.py @@ -64,6 +64,9 @@ class FrontendWidget(HistoryConsoleWidget): """ A Qt frontend for a generic Python kernel. """ + # ConsoleWidget interface. + tab_width = 4 + # Emitted when an 'execute_reply' is received from the kernel. executed = QtCore.pyqtSignal(object) @@ -139,7 +142,8 @@ class FrontendWidget(HistoryConsoleWidget): if self._get_prompt_cursor().blockNumber() != \ self._get_end_cursor().blockNumber(): spaces = self._input_splitter.indent_spaces - self.appendPlainText('\t' * (spaces / 4) + ' ' * (spaces % 4)) + self.appendPlainText('\t' * (spaces / self.tab_width)) + self.appendPlainText(' ' * (spaces % self.tab_width)) def _prompt_finished_hook(self): """ Called immediately after a prompt is finished, i.e. when some input