Tabs showing as 1 space after moving to WebStorm 9

Just installed WebStorm 9, and imported my settings from 8.05.  Things look generally the same, but my tab indentation now has a tab width equivalent to a single space.

I have tab characters visible, so I know they're tabs and not actually single spaces.  I've gone into [Default ]Settings and verified I have "Use tab character" checked, and Tab size: and Indent: both set to 4 (although the help for Indent: seems to wrongfully imply that its units are in tabs if Use tab character is checked).  The previews in the settings panel look great with tab characters showing at widths of 4 spaces.

I've tried:
- Code -> Reformat Code... on both a selection and the entire file.
- changing the values and changing them back to try to tickle the editor to re-apply the settings
- disabling the IdeaVIM / Vim emulator plugin and or trying :set tabstop 4 there (though I never had to do it in WebStorm 8)

WebStorm 9 really wants to display single-spaced tabs, no matter what my settings or what type of file (JS/HTML/SCSS)

Any ideas?

8 comments
Comment actions Permalink

Hi there,

Any ideas?

1) Screenshots of your settings, please. As well as how it looks in editor.
2) Any 3rd party (non bundled) plugins installed?

0
Comment actions Permalink

I have the same problem. See the screenshot attatched.



Attachment(s):
webstorm_tabs.png
0
Comment actions Permalink

I also have this issue, although not when creating a new project from scratch. I noticed that a
file .editorconfig was created in my existing project root. Overwriting these
values solved the issue for now.


0
Comment actions Permalink

1) In your case Tab is actually 2 spaces not 1. But anyway...

2) I'm not 100% sure on your "Default (1)" code style scheme -- which suggests that it was created by IDE when you tried to modify the settings.

I believe such automatically created scheme sometimes fails to work properly (it's kind of there .. but IDE kind of ignores it/forgets about it).

I suggest to manually create your own code style scheme by duplicating "Default" one (use "Manage" button and use "Save As" on Default) -- at least we will rule this possibility out.

3) Quite likely it could be because of EditorConfig plugin. If you have one -- please disable it and see if it will make any difference.

If it does -- check values in .editorconfig files -- possibly it has "tab = 2 spaces" (or whatever the format is) there.

0
Comment actions Permalink

I've deleted the .editorconfig file after check that it had no data of value for me. Then I reopened WebStorm and the tab settings work now like a charm. It seems the .editorconfig file was overriding the IDE config. Thank you Andriy!

0
Comment actions Permalink

Yes -- that's the purpose of .editorconfig files -- to provide specific settings (override your globals) for files in this and lower folders.

So .. if you do not want to use them at all -- just delete such files. Otherwise -- edit them with correct settings.

0
Comment actions Permalink

The culprit was in fact the .editorconfig file in my project's root directory, placed there by Yeoman.  WebStorm 9 honors this file over its own settings, where WebStorm 8 happily ignored the file.

In my .editorconfig I had set the following values:

indent_style = tab
indent_size = 1

I wrongly assumed the units of indent_size were the value of indent_style, instead of always spaces (as I mentioned in my original post, the WebStorm documentation for its "Indent:" setting is also misleading on this point).

At the time of my edit I wasn't using an editor/IDE (or plugin) that read .editorconfig to immediately expose my mistake.  The documentation at editorconfig.org verifies that WebStorm EditorConfig plugin is interpreting indent_size correctly and doing the right thing.

Actually now that I go back into the WebStorm 9 settings, I see the Enable EditorConfig support checkbox down at the bottom, and even the warning that "EditorConfig may override the IDE code style settings". I would suggest one or more of the following: 1) the EditorConfig group be placed at the top of the dialog; 2) the warning be colored yellow or red; and ideally 3) the overridden values be grayed out or otherwise annotated.

Anyway, thank you all very much for discovering what the issue was!

0
Comment actions Permalink

You are welcome to submit your suggestions to the Issue Tracker at https://youtrack.jetbrains.com/issues/WEB

0

Please sign in to leave a comment.