Permalink
Browse files

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
  • Loading branch information...
1 parent 2059d0a commit 33cfae80bb9bcf6102adb314ce56b736db0738a7 @minrk minrk committed Oct 20, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 IPython/frontend/qt/console/console_widget.py
@@ -1158,7 +1158,10 @@ def _event_filter_console_keypress(self, event):
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:

0 comments on commit 33cfae8

Please sign in to comment.