change auto-indent style
Hello, I'm trying out webstorm and I would like to change the style of the auto-indent.
Right now, when I start writing a function for example, it indents automatically.
function a()
{
var b;
}
but I would like to be:
function a()
{
var b;
}
Also with ifs.
if ( something )
{
var b;
}
and would prefer:
if ( something )
{
var b;
}
How do you change it?
请先登录再写评论。
There doesn't appear to be an easy way to get both the behaviours you are after, however, you can get close:
This results in functions/ifs/loops/etc that have their code in-line with their surrounding braces, though as stated, the functions have their braces indented, which is slightly different from what you wanted.
Thanks for the suggestion, but for whatever reason, I don't get the code like in the settings example:
function a()
{
return 0;
}
but:
function a()
{
return 0;
}
yea, isn't really this :(
Were you able to resolve this issue? I can't seem to find a solution, it still automatically indents after you open your curly brace.
Setting Code Style/javaScript/Wrapping and Braces, 'In Function Declaration' and 'Other' to 'Next line shifted' affects auto-formatter (the code is reformatted accordingly on Ctrl+Alt+L), but doesn't affect 'Smart Indent' behavior. Logged as http://youtrack.jetbrains.com/issue/WEB-11401, please follow it for updates