Home Download Buy Blog Forum Support

Tab spaces issue on OS X

Tab spaces issue on OS X

Postby figbash on Thu Dec 08, 2011 9:04 pm

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! :)
figbash
 
Posts: 14
Joined: Fri Jul 29, 2011 8:36 pm

Re: Tab spaces issue on OS X

Postby quarnster on Thu Dec 08, 2011 9:14 pm

Maybe if you set this to false in your Base File.sublime-settings?
Code: Select all
   // Set to false to disable detection of tabs vs. spaces on load
   "detect_indentation": true,
quarnster
 
Posts: 389
Joined: Tue Nov 29, 2011 11:34 am

Re: Tab spaces issue on OS X

Postby guillermooo on Thu Dec 08, 2011 9:16 pm

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.
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: Tab spaces issue on OS X

Postby figbash on Thu Dec 08, 2011 9:22 pm

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 :)
figbash
 
Posts: 14
Joined: Fri Jul 29, 2011 8:36 pm

Re: Tab spaces issue on OS X

Postby guillermooo on Thu Dec 08, 2011 9:32 pm

Hm... that's odd, because "Guess Settings from Buffer" actually toggles "detect_indentation".
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: Tab spaces issue on OS X

Postby figbash on Thu Dec 08, 2011 9:35 pm

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.
figbash
 
Posts: 14
Joined: Fri Jul 29, 2011 8:36 pm

Re: Tab spaces issue on OS X

Postby adzenith on Thu Dec 08, 2011 9:44 pm

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.
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: Tab spaces issue on OS X

Postby guillermooo on Thu Dec 08, 2011 9:58 pm

Yeah, that's true. I actually opened the .sublime-menu file, so I don't know what I was reading :D
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am


Return to Technical Support

Who is online

Users browsing this forum: Yahoo [Bot] and 27 guests