开发者

Eclipse hotkey that word wraps all my code?

开发者 https://www.devze.com 2023-01-25 20:38 出处:网络
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!!!

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消