Sublime Forum

Tab size defaults to 2

#1

I have a simple .inc file with a mixture of ASP and HTML. In fact, it’s just few lines of ASP wrapped in <% %>. The problem is that tabSize seems to default to 2 no matter what I do or set. I have no per file settings anywhere; I only have set:

translateTabsToSpaces true
tabSize 4

in my user settings. It is working in all cases except this particular file. It almost seems that there is something wrong with the file. I tried to delete various portions of the file, and I think at one point I managed to get 4 spaces per tab, but there was nothing suspicious in the section I deleted. Also, I removed the inc extension from all packages, and it still behaved the same even if the file was threated as plain text.

Edit: I just found out what was that probably. The file in question was already formatted with two-space indentation, and Sublime was probably being smart as guessed that. I just noticed that there is a “Guess indentation from buffer” function. Is there a way to turn it off (in case I need it)?

Edit 2: OK, this is embarrassing. I found the settings. It’s called detectIndentation. I could not find it before, because I did not realize my search was set to “full words” and “case sensitive”. I guess this post will stay here as a manifestation of a moment of stupidity.

0 Likes

#2

That’s ok… the same thing happened to me 2 weeks ago.

Maybe Sublime could give some kind of message saying this happened, so others don’t get confused? I’ll once again mention the “message” api I’d like Sublime to have (mentioned in the Feature Requests forum).

0 Likes