可以在 Eclipse 中更改 CTRL + SHIFT + F 的设置吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15221225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Possible to change settings for CTRL + SHIFT + F in Eclipse?
提问by 3D-kreativ
When I use the combinations of CTRL+ SHIFT+ Fto format the code in Eclipse, I don't like when it brakes the lines like this:
当我使用的组合CTRL+ SHIFT+F格式在Eclipse代码,我不喜欢当刹车线是这样的:
Toast.makeText(Activity_1.this, String.valueOf(numbersOfRows),
Toast.LENGTH_LONG).show();
If I want to put comment signs like // in the beginning of the line, then I have to do the same on the second line otherwise I get an error!
如果我想在行的开头放置像 // 这样的注释符号,那么我必须在第二行做同样的事情,否则我会得到一个错误!
Is there a way to prevent braking rows like that?
有没有办法防止这样的刹车行?
回答by jtrentes
You can configure your formatter options in "windows/Preferences/Java/Code Style/Formatter". Click on edit your profile. Here you have "line wrapping" options.
您可以在“windows/Preferences/Java/Code Style/Formatter”中配置格式化程序选项。单击编辑您的个人资料。在这里,您有“换行”选项。
回答by Erina Thanikkal
Set "Line width for preview window" option and "maximum line width" option in Preferences/Java/Code Style/Formatter. Before that you should create a new profile name instead of default profile name
在 Preferences/Java/Code Style/Formatter 中设置“预览窗口的线宽”选项和“最大线宽”选项。在此之前,您应该创建一个新的配置文件名称而不是默认配置文件名称