MyEclipse中防止代码格式化时出现换行的情况的设置

编辑完成代码,用MyEclipse的代码格式化后,本来不长的代码也被自动转成了多行。虽然自动换行以后在编辑器中一眼就能看到全部的代码,但是可读性却大打折扣,避免出现这种情况的办法是:

1.Java代码

打开Eclipse的Window菜单,然后Preferences->Java->Code Style->Formatter->Edit/Show(根据不同版本可用的按钮会不一样) ->Line Wrapping->Maximum line width:由默认的80改成自己想要设定的长度

2.Html代码

Window->Preferences->MyEclipse->Files and Editors->Html->Html Source->Line width->加个0以后保存。

3.xml代码

Window->Preferences->MyEclipse->Files and Editors->xml->xml Source->->Line width->999

posted @ 2010-10-19 18:33  MyFavorite  阅读(1387)  评论(0编辑  收藏  举报