Sublime Forum

tab_size in snippet not working

#1

I’ve got Preferences.sublime_settings set like this:

{ "tab_size": 2, "translate_tabs_to_spaces": true }

And I have an .editorconfig file in my root like this:

root = true

*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[package.json]
indent_style = space
indent_size = 2

*.md]
trim_trailing_whitespace = false

In my file, I have indentations set to 2. However, when I try to use this file github.com/reactjs/sublime-reac … me-snippet in the React package, which uses a single tab, I am getting 4 spaces and not 2.

I feel like I’m missing something. Why are all of my settings being overridden? Thanks!

0 Likes

Tab Size in snippets not using preference
#2

What does ST display in the status bar for tab size? What does view.settings().get("tab_size") in the console print?

0 Likes

Tab Size in snippets not using preference
#3

The status bar says Spaces: 2 and Tab width: 2 in the popup.

Here’s the console:

EditorConfig
~/src/sandbox/test.jsx
{'charset': 'utf-8',
 'end_of_line': 'lf',
 'indent_size': '2',
 'indent_style': 'space',
 'insert_final_newline': 'true',
 'tab_width': '2',
 'trim_trailing_whitespace': 'true'}

SublimeLinter: jscs activated: /usr/local/bin/jscs (disabled in settings) 
SublimeLinter: jshint activated: /usr/local/bin/jshint 
>>> view.settings().get("tab_size")
2
0 Likes

#4

That is very weird indeed. I’m afraid I can’t troubleshoot this any deeper because this has always worked for me and I don’t know the code points where this could get messed up.

0 Likes