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

问题描述 投票:5回答:1

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

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

// Joining the above two lines results in this:
something().somethingElse() .yetAnotherThing();

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

// Notice there is no excess whitespace
something().somethingElse().yetAnotherThing();
eclipse keyboard-shortcuts
1个回答
4
投票

至于Eclipse 3.3引入的特定“连接线”命令,在我的情况下绑定到Ctrl + Alt + J,我认为我们目前仍然坚持添加空间。这是一个known bug

您可能会掷骰子而是选择线条并尝试格式化命令(对我而言,它绑定到Shift + Ctrl + F)以查看它是否表现得更好。

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

© www.soinside.com 2019 - 2024. All rights reserved.