dsdsdsdsd
dsdsdsdsd

Reputation: 2962

eclipse: how to deactivate auto-adjusting of method brackets

I have turned off all of the intelligent typing preferences that I can 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?

Upvotes: 2

Views: 541

Answers (2)

Matt Ball
Matt Ball

Reputation: 359786

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

enter image description here

enter image description here

Upvotes: 3

Nirmal- thInk beYond
Nirmal- thInk beYond

Reputation: 12054

GO TO

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

set your preferred margine then select your code and press

Ctrl + Shift + F

Upvotes: 1

Related Questions