From 33cfae80bb9bcf6102adb314ce56b736db0738a7 2011-10-20 18:17:51 From: MinRK Date: 2011-10-20 18:17:51 Subject: [PATCH] add 4-space soft-tabs to qtconsole pressing tab inserts four spaces, so there should never be any '\t' characters inserted by typing. closes gh-900 closes gh-513 --- diff --git a/IPython/frontend/qt/console/console_widget.py b/IPython/frontend/qt/console/console_widget.py index 52b959f..3d539ce 100644 --- a/IPython/frontend/qt/console/console_widget.py +++ b/IPython/frontend/qt/console/console_widget.py @@ -1158,7 +1158,10 @@ class ConsoleWidget(LoggingConfigurable, QtGui.QWidget): elif key == QtCore.Qt.Key_Tab: if not self._reading: - intercepted = not self._tab_pressed() + if self._tab_pressed(): + # real tab-key, insert four spaces + cursor.insertText(' '*4) + intercepted = True elif key == QtCore.Qt.Key_Left: