+1
Not a bug
Carlos Rodriguez 6 years ago • updated by Jon Skinner 6 years ago 2
Seems like something has changed in the latest beta where new files do not respect my tab preferences.

For example: I have the following set in the Preferences.sublime-settings file:

"tab_size": 2,
"translate_tabs_into_spaces": true,
"trim_trailing_white_space_on_save": true

When opening a new file or even that file itself, it's using tabs instead of spaces.

Here is an screenshot:

Answer

Answer
Not a bug
Please see the documentation about detect_indentation: http://www.sublimetext.com/docs/2/indentation.html
Answer
Not a bug
Please see the documentation about detect_indentation: http://www.sublimetext.com/docs/2/indentation.html
Jon,

I still think something is not right.

Here are the contents of my Preferences.sublime-settings file:

{
"auto_complete": false,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"draw_indent_guides": false,
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",
"*.so",
"*.dylib",
"*.ncb",
"*.sdf",
"*.suo",
"*.pdb",
"*.idb",
"*.DS_Store",
"*.pdf",
"*.class",
"*.jpg",
"*.gif",
"*.png"
],
"fold_buttons": false,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
"log",
"sphinx",
"vendor/ruby"
],
"font_options":
[
"subpixel_antialias"
],
"highlight_line": true,
"hot_exit": false,
"ignored_packages":
[
"Vintage"
],
"detect_indentation": false,
"remember_open_files": false,
"tab_size": 2,
"translate_tabs_into_spaces": true,
"theme": "Soda Dark.sublime-theme",
"trim_trailing_white_space_on_save": true
}

As you can see I have detect_indentation as false, my tab_size is set to 2 and translate_tabs_to_spaces is set to true.

Looking in the documentation, the order for tab spaces is thus:
  1. Packages/Default/Base File.sublime-settings
  2. Packages/Default/Base File (<platform>).sublime-settings
  3. Packages/User/Base File.sublime-settings
  4. Packages/<syntax>/<syntax>.sublime-settings
  5. Packages/User/<syntax>.sublime-settings
I don't have any syntax specific settings for Ruby files, yet when I open a Ruby file in a project, it defaults not to use spaces instead of tabs. You can see in this screenshot this is not happening:

Jon,

I think I see an issue. I'm not sure if the the API changed, but the key that I had was translate_tabs_into_spaces, but it looks like the key is now translate_tabs_to_spaces.