Eclipse 热键那个词包含了我所有的代码?

发布于 2024-10-02 19:59:56 字数 532 浏览 0 评论 0原文

好吧,这已经是我第十次发生这种事了。

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

锦爱 2024-10-09 19:59:56

它可能是 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.

灵芸 2024-10-09 19:59:56

是的,它是 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文