开发者

eclipse: how to deactivate auto-adjusting of method brackets

开发者 https://www.devze.com 2023-02-23 00:40 出处:网络
I have turned off all of the intelligent typing preferences that I ca开发者_JAVA技巧n find ... however, when I create a method, eclipse forces my { to align left ...

I have turned off all of the intelligent typing preferences that I ca开发者_JAVA技巧n find ...

however, when I create a method, eclipse forces my { to align left ...

private my_method()
{
}

I prefer:

private my_meth()
  {
  }

it also auto left-aligns nested brackets:

private my_meth()
{
  if ( true )
{
}
}

where I prefer:

private my_meth()
  {
    if ( true )
      {
      }
  }

is there a way to tell eclipse to stop doing that?


Preferences -> Java -> Code Style -> Formatter -> Edit -> Braces.
The brace position you want is Next line indented.

eclipse: how to deactivate auto-adjusting of method brackets

eclipse: how to deactivate auto-adjusting of method brackets


GO TO

Preferences -> Java -> Code Style -> Formatter -> Edit -> Braces

set your preferred margine then select your code and press

Ctrl + Shift + F

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号