如何让eclipse不自动缩进代码块
我喜欢 Eclipse 的自动缩进功能,但有时我有一些缩进,我不希望它被纠正,就像
audioBuffer1[j] = (short) (VOLUME_REDUCER * ( inputBuffer[i]
+ ALPHA * inputBuffer[i - echo1a]
+ ALPHA * inputBuffer[i + echo1a]
- ALPHA * inputBuffer[i - echo1b]
- ALPHA * inputBuffer[i + echo1b]
));
它被纠正为可怕的东西一样。有没有办法让自动缩进功能跳过一些代码,使用 @annotation 或其他东西?
I like Eclipse's auto-indent function, but sometimes I've got some indentation I don't want it to correct, like
audioBuffer1[j] = (short) (VOLUME_REDUCER * ( inputBuffer[i]
+ ALPHA * inputBuffer[i - echo1a]
+ ALPHA * inputBuffer[i + echo1a]
- ALPHA * inputBuffer[i - echo1b]
- ALPHA * inputBuffer[i + echo1b]
));
which gets corrected to something horrible. Is there a way of making the auto-indent function skip over some bits of code, using an @annotation
or something?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以将//放在您不希望其换行的行的末尾。
You can put // at the end of the lines you don't want it to wrap.
有关禁用自动缩进的信息,请参阅 bug 193688 和 bug 319532(不早于 3.7M2)。
您将能够设置“打字”页面的首选项以启用/禁用新行上的智能缩进。如果禁用,它仍然缩进到上一行。
注意:对于一般格式(自 Eclipse3.6 JDT 起)
bug 27079(“用于禁用/启用代码格式化程序的标签”)及其附加补丁 正在解决该特定功能(这并不完全是您想要的)。
For disabling auto-indent, see bug 193688 and bug 319532 (not before 3.7M2).
You will be able to set the preference to the Typing page to enable/disable smart indent on New Line. If disabled, it still indents to previous line.
Note: For format in general (since Eclipse3.6 JDT)
The bug 27079 ("Tags for disabling/enabling code formatter") and its attached patch are addressing that particular feature (which is not exactly what you want here).
没有用于控制格式化行为的注释,但我发现关闭编辑 -> 很有帮助。在插入您不想弄乱的代码块之前使用智能插入模式。
There isn't an annotation to control formatting behavior, but I find it helpful to turn off Edit -> Smart Insert Mode prior to inserting a block of code that you don't want to be messed with.
您可以使用
You can use