我仍然使用Eclipse的换行特性来格式化我的java代码。我不希望Eclipse自动连接折行,所以我选中了“从不连接已经折行”,但当我格式化代码时,它仍然连接折行。
示例:
return ((this.isVertical == aLine.isVertical) &&
(Math.abs(this.a - aLine.a) <= EPSILON) &&
(Math.abs(this.b - aLine.b) <= EPSILON));格式化代码:
return ((this.isVertical == aLine.isVertical) &&
(Math.abs(this.a - aLine.a) <= EPSILON) && (Math.abs(this.b - aLine.b) <= EPSILON));请告诉我怎样才能修好它。谢谢!
发布于 2012-01-11 04:13:45
在Workspace->Preferences-Java->Code Style->Formatter中,编辑配置文件和换行选项卡,然后选择表达式。有很多很多的选择。
https://stackoverflow.com/questions/8809743
复制相似问题