当然,像 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');
}
});
我该如何解决这个问题,使其格式如下:
$(document).ready(function() {
if (someVar > 2)
{
// this is how it's done
}
else if (someVar == -1)
// this is right
else
{
// correct
}
});