Sublime Forum

TABs translates to spaces

#1

Hi,

I don’t know, if it’s a bug or something wrong. In some files, when I click TAB it makes 4 spaces instead of tab, in other files everything is fine. It just can’t make tabs in some files, while in others it can. I’ve set translate_tabs_to_spaces to false. What can cause this?
I’m using win7 64bit, I can record the video if required.

Thanks.

0 Likes

#2

It’s not a bug it’s a feature :stuck_out_tongue:
Sublime Text auto-detect the indentation type of a file and will override your default setting.
If you don’t want this behavior you can add “detect_indentation”: false in your settings.

0 Likes

#3

[quote=“Clams”]It’s not a bug it’s a feature :stuck_out_tongue:
Sublime Text auto-detect the indentation type of a file and will override your default setting.
If you don’t want this behavior you can add “detect_indentation”: false in your settings.[/quote]

Oh, I thought it’s a bug, thanks a lot :smiley:.

0 Likes

#4

Just to clarify that I have the right idea:

If I want to turn off the detect_indentation heuristic and to enable translation of tabs to spaces for Python, I just need to create a file
Packages/Python/Python.sublime-settings with:

{
“detect_indentation”: false,
“translate_tabs_to_spaces”: true
}

Are there any other behaviors that will be affected? I am not saying that the auto detect is a bad thing - I’m just playing around with the features to get a feel for them.

Thanks.

0 Likes