Eclipse 热键那个词包含了我所有的代码?
好吧,这已经是我第十次发生这种事了。
我在 Eclipse 中按下了一些热键,它“自动换行”了我的所有代码!
示例(注意新行上的加号):
// Split the formula into two parts: bit/byte range, and formula.
try {
formulaParts = formulaAndBitPositions.split(",");
} catch (Exception e) {
msg("PD ERROR during decode: DPN=" + DPN
+ " formulaAndBitPositions=" + formulaAndBitPositions
+ " E= " + e.getMessage());
return;
}
因此,每行长度超过 80 个字符的行都会被换行!咕噜咕噜!
有人知道是哪个可怕的热键造成的吗?
Alright, this is about the tenth time this has happened to me.
I bumped some hotkey in Eclipse and it "word-wrapped" ALL OF MY CODE!!!
Example (notice the plus signs all on new lines):
// Split the formula into two parts: bit/byte range, and formula.
try {
formulaParts = formulaAndBitPositions.split(",");
} catch (Exception e) {
msg("PD ERROR during decode: DPN=" + DPN
+ " formulaAndBitPositions=" + formulaAndBitPositions
+ " E= " + e.getMessage());
return;
}
So every line that was longer than about 80 characters got wrapped! grrrrrrrrr!
Anybody know which horrible horrible hotkey is responsible for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它可能是 Ctrl + Shift + O(格式代码)。
更新:
抱歉,我的错误。它的 Ctrl + Shift + F 用于格式代码。 Ctrl + Shift + O 用于组织代码。我经常把它们混合起来。
It may be Ctrl + Shift + O (Format Code).
Updates:
Sorry, my mistake. Its Ctrl + Shift + F for Format Code. Ctrl + Shift + O is for Organize Code. I often mix them.
是的,它是 Ctrl+Shift+F,但您始终可以更改配置以指导 Eclipse 如何为您进行格式化。在“首选项”窗口中搜索“margin”或类似内容,然后将“80”更改为您喜欢的值,例如 120。
Yes it's Ctrl+Shift+F, but you can always change the configurations to guide how Eclipse does the formatting for you. Search "margin" or something like that in the Preferences window and change the "80" to one you like, e.g. 120.