Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Tab key should insert 4 spaces in qt console #900

Closed
fperez opened this Issue · 1 comment

2 participants

@fperez
Owner

Currently the tab key, when not completing, inserts a hard tab in the qt console. That makes it harder to paste that code later into editors, and also causes other issues as discussed in #513.

I'm tagging this as bug and not enhancement b/c tab-as-4-spaces is pretty much a universal python standard at this point, so the fact that we don't quite follow it in this context, should be seen as a bug.

@minrk
Owner

#513 isn't actually other issues, it's exactly this. It was misunderstood as the wrong number of spaces because tabs align with tab-stops, so vary in width.

I added a fix to the qtconsole-menu PR, as it's two lines. Should close both issues.

Now that tabs=4sp is so standard, you might think the Python interpreter would stop reading tabs as 8 spaces with respect to indentation:

exec "def foo():\n\ta=5\n        return a\nprint foo()"
@minrk minrk closed this issue from a commit
@minrk minrk 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
33cfae8
@minrk minrk closed this in 33cfae8
@ellisonbg ellisonbg referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@mattvonrocketstein mattvonrocketstein referenced this issue from a commit in mattvonrocketstein/ipython
@minrk minrk 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
cc6d90c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.