weights
weights

Reputation: 59

change the space between if() and { in Eclipse

When I type if() then { it looks like this if() { with space and without the right curly brackets
I want when I type if() then { to look like this without space and with the right curly brackets

if(){
   //code
}

Upvotes: 1

Views: 857

Answers (1)

Pshemo
Pshemo

Reputation: 124235

Go to

Window -> Preferences -> Java -> Code Style -> Formatter -> Edit -> White Space (tab) -> Control statements -> Blocks

There deselect option "before opening brace".

enter image description here enter image description here

To also remove space before else deselect "after closing brace".

Upvotes: 6

Related Questions