For example, joining these two lines with the keyboard shortcut CTRL+J in Eclipse results in the following:
something().somethingElse()
.yetAnotherThing();
// Joining the above two lines results in this:
something().somethingElse() .yetAnotherThing();
Is there a way to join those lines so it results in this:
// Notice there is no excess whitespace
something().somethingElse().yetAnotherThing();
As far as the specific "join lines" command introduced with Eclipse 3.3 which in my case is bound to Ctrl+Alt+J, I think we are currently stuck with the addition of the space. It is a known bug.
You might throw the dice and instead select the lines and try the format command (for me it is bound to Shift+Ctrl+F) to see if that behaves any better.
Selecting the lines ahead of requesting the format should limit the scope of formatting to the selected lines.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With