Indent after line break in html.erb files is always 2 spaces. Can you change it?
I have looked through every option in settings and can't find a way to change this.
The problem:
In a .html.erb file (a Rails view), when you type the opening tag for a new element, e.g. "<div>" and then press enter, the new line is always indented 2 spaces from the above "<div>" tag, even though my HTML indent settings are set to 1 'tab character' (e.g., when I press the TAB key in a .html.erb file, it indents 1 tab charcter, not 2 spaces).
So what I have to do now is type the opening "<div>" element, press enter (creating 2 spaces indent), press backspace twice to remove the indent, and then press the TAB key to add the correct 1 tab character as an indent, which obviously won't work in the long term.
Any help is much appreciated.
Please sign in to leave a comment.
Hi,
change indent size on "Settings"::"Code Style"::"XML" page.
We do believe that erb is closer to XML than to HTML ;)
Regrds, Oleg
Wow, I must have tried changing the settings for every single language except XML, thank you! :)
you are welcome :)