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?
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.
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.
精彩评论