关闭块注释后,如何防止升华文本缩进?

Sha*_*eel 2 javascript sublimetext sublimetext2 sublimetext3

如果我有一些要注释掉的JavaScript代码,例如:

{
    // Inside some scope
    var foo = "bar";
    foo += "bar";
}
Run Code Online (Sandbox Code Playgroud)

我希望在注释掉代码后具有以下内容

{
    /*
    // Inside some scope
    var foo = "bar";
    foo += "bar";
    */
}
Run Code Online (Sandbox Code Playgroud)

但是,相反,我将得到如下内容,必须重新缩进:

{
    /*
    // Inside some scope
    var foo = "bar";
    foo += "bar";
*/
}
Run Code Online (Sandbox Code Playgroud)

我想知道是否有防止这种情况发生的偏好。

Som*_*ens 5

突出显示要注释掉的代码,然后按ctrl + /-这将注释掉该代码而没有任何缩进问题,并且很容易反转。此策略的另一个优点是,它适用于大多数语言(包括HTML)。

另外,您可以使用ctrl + shift + /多行注释,如rlemon在注释中提到的。(通常我太懒了)