Sublime Forum

Tab spaces issue on OS X

#1

Hello, I’m using build 2139 on OS X Lion. I have “translate_tabs_to_spaces”: false as the option for tab spaces.

I’m having an issue where 90% of my files insert tabs when I press tab, but a couple files insert spaces instead, and there doesn’t seem to be any real reason I can discover that makes those files special. It seems to have started being an issue within the last month of updates, I never had the problem before, and I got it immediately after updating. I don’t always keep up to date on builds so I’m not sure which build this was introduced.

If anyone has any suggestions they would be greatly appreciated, it’s driving me nuts! :smile:

0 Likes

#2

Maybe if you set this to false in your Base File.sublime-settings?

	// Set to false to disable detection of tabs vs. spaces on load
	"detect_indentation": true,
0 Likes

#3

Sublime Text has global, user-defined and file-type-level settings. “translate_tabs_to_spaces” could be set to true for some file types only. You should be able to inspect all of them from the Preferences menu. Also, check out the View | Indentation Settings and make sure “Guess Settings from Buffer” is off. You can also use built-in commands to convert back and forth between spaces and tabs in a buffer if they’re using the wrong whitespace.

0 Likes

#4

guillermooo: They are all the same filetypes, and guess settings was off, but thanks!

quarnster: That solved my issue, thank you. For some reason it is detecting some files wrong. Not sure why, since none of them had space indentation until sublime started messing up :smile:

0 Likes

#5

Hm… that’s odd, because “Guess Settings from Buffer” actually toggles “detect_indentation”.

0 Likes

#6

Interesting, there may be a UI issue with that, as I cannot get a check mark to appear next to that option. I had assumed it was off as it did not show as checked.

0 Likes

#7

If you have detect_indentation on, then it runs a command to detect the indentation every time you open a buffer. I believe “guess settings from buffer” just runs this command once for the current file; I don’t think it actually toggles the setting.

0 Likes

#8

Yeah, that’s true. I actually opened the .sublime-menu file, so I don’t know what I was reading :smiley:

0 Likes