在没有空格的情况下加入Eclipse中的行

Ste*_*ven 5 eclipse keyboard-shortcuts

例如,在Eclipse中使用键盘快捷键CTRL+ 连接这两行会J导致以下结果:

something().somethingElse()
    .yetAnotherThing();

// Joining the above two lines results in this:
something().somethingElse() .yetAnotherThing();
Run Code Online (Sandbox Code Playgroud)

有没有办法加入这些行,所以它导致:

// Notice there is no excess whitespace
something().somethingElse().yetAnotherThing();
Run Code Online (Sandbox Code Playgroud)

uni*_*eek 5

至于 Eclipse 3.3 中引入的特定“连接线”命令(在我的例子中绑定为Ctrl+ Alt+ J),我认为我们目前陷入了添加空格的困境。这是一个已知的错误

您可以扔骰子,然后选择行并尝试格式命令(对我来说它绑定到Shift+ Ctrl+ F),看看效果是否更好。

在请求格式之前选择行应将格式化范围限制为所选行。