Sublime Forum

All of a sudden my tabs are 4

#1

Weird thing happened today… my tabs are set to 2 space, yet somehow they are now indenting 4 spaces. I didn’t do anything to my settings, I opened up my user preferences and sure enough, the setting is the same as it should be, which is 2. Sublime isn’t listening to my settings anymore, I have not installed any new plugins, and I haven’t really changed anything today with the editor.

Wonder how this could have happened… anyone have an idea?

0 Likes

#2

Sometimes happens to me as well due to reasons I don’t understand. Nudge Sublime into the correct tab settings by clicking the “tab size: …” / “spaces: …” indicator at the right-hand side of the status bar.

0 Likes

#3

Wow, that is really hidden! This was driving me nuts.

0 Likes

#4

It’s probably happening because of this preference:

[quote] // Set to false to disable detection of tabs vs. spaces on load
“detect_indentation”: true,
[/quote]

If it looks like your code has four-space indents, Sublime Text will set your file to four spaces. Unfortunately it’s not the best at guessing; I believe it looks for the most common indentation amount, so e.g. if most of your code is at your second indentation level (4 spaces in a 2-space document) Sublime Text will think the document is 4-spaced.

0 Likes

#5

Cool… thanks for the reply!

I didn’t realize before posting this that you can set all of your options on a project basis as well, which is pretty amazing. All of the flexibility makes up for slight inconveniences like this… but it was a bit annoying.

0 Likes