Home Download Buy Blog Forum Support

Wrong TAB size on new line (Python)

Wrong TAB size on new line (Python)

Postby eka on Fri Apr 27, 2012 3:03 pm

Hi, when working on a class definition on Python it happens that a doing <tab> will jump 8 spaces instead of 4.
In the attached pic you can see that the bad jump is in RED, the one happening now. The green should be the right jump.
When working with functions, it works ok, the problem is in class definitions.

Any clue why?

Image
eka
 
Posts: 7
Joined: Thu Mar 29, 2012 12:37 pm

Re: Wrong TAB size on new line (Python)

Postby eka on Tue May 01, 2012 1:59 pm

Bump
eka
 
Posts: 7
Joined: Thu Mar 29, 2012 12:37 pm

Re: Wrong TAB size on new line (Python)

Postby C0D312 on Tue May 01, 2012 2:03 pm

This is Sublime Text trying to guess where you want the cursor. The editor thinks you still want to be in the function. You can turn this off by adding
"smart_indent": true

to Preferences: Settings - User.

There is also 'auto_indent.' I don't know which one is actually responsible for your dilemma so you try and figure it out (I personally like this behavior).
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Wrong TAB size on new line (Python)

Postby eka on Tue May 01, 2012 2:15 pm

C0D312 wrote:This is Sublime Text trying to guess where you want the cursor. The editor thinks you still want to be in the function. You can turn this off by adding
"smart_indent": true

to Preferences: Settings - User.

There is also 'auto_indent.' I don't know which one is actually responsible for your dilemma so you try and figure it out (I personally like this behavior).


I think I tried that.. but see this vid, http://youtu.be/DyCW36CTwKc is kind of annoying. Let you know.
eka
 
Posts: 7
Joined: Thu Mar 29, 2012 12:37 pm

Re: Wrong TAB size on new line (Python)

Postby eka on Tue May 01, 2012 2:20 pm

Code: Select all
"smart_indent": true
doesn't do the trick... I remember now that I tried all combinations... IMHO ST2 should do 1 level down if there are at least 2 blank lines... that will fix it.

If it's using python code to do that I may take a look to see if I can tweak it, but I don't know where to look.
eka
 
Posts: 7
Joined: Thu Mar 29, 2012 12:37 pm

Re: Wrong TAB size on new line (Python)

Postby C0D312 on Tue May 01, 2012 2:24 pm

Hmm... you behavior seems different than mine. Perhaps is from a plugin?

Anyway, try settings auto_indent to false. That disables this indentation for me. If that doesn't change anything, it's most likely a plugin.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: Wrong TAB size on new line (Python)

Postby eka on Tue May 01, 2012 2:37 pm

C0D312 wrote:Hmm... you behavior seems different than mine. Perhaps is from a plugin?

Anyway, try settings auto_indent to false. That disables this indentation for me. If that doesn't change anything, it's most likely a plugin.


Yes that does it, but I want auto_indent on <enter> :(

I think is a bug in either smart_indent or auto_indent, if it could detect that after 2 blank lines I don't want to be working inside the previous method but start a new one, that will do it.

Thanks
eka
 
Posts: 7
Joined: Thu Mar 29, 2012 12:37 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 30 guests