Cap*_*ack 5 netbeans indentation auto-indent
当然,像NetBeans一样功能强大的IDE并不是一件容易的事,但是因为我只是在输入代码,所以这就是它如何格式化它:
$(document).ready(function() {
if (someVar > 2)
{
complain('that is not how you indent braces');
}
else if (someVar == -1)
complain('this is not right either!');
else
{
complain('but it did auto outdent the else which is smart');
complain('smart indeed');
}
});
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题,因此格式如下:
$(document).ready(function() {
if (someVar > 2)
{
// this is how it's done
}
else if (someVar == -1)
// this is right
else
{
// correct
}
});
Run Code Online (Sandbox Code Playgroud)
代码格式化在 NetBeans 的早期版本中不是可用的功能,但在 NetBeans 7 的发布中被添加到程序中(我相信)。尝试转到“工具”->“选项”->“编辑器”->“格式”,看看有哪些可用选项,因为如果可以的话,您可以在其中添加代码格式。
如果这不能解决问题,我建议执行以下操作(无特定顺序)。
归档时间: |
|
查看次数: |
2476 次 |
最近记录: |