Sublime Text 3 在 javascript 中仅在括号中按下回车键后缩进一个额外的制表符

Sublime Text 3 indents an extra tab after hitting enter for only parentheses in javascript

现在,我正在开发一个在 Sublime Text 中使用 ReactJS 的项目。每当我在括号之间按下回车键时,它就会换行并添加一个额外的 space。这是一个例子:

初始开始

光标在中间,然后我回车:

当前结果

然后它会在之后添加这个额外的缩进。害得我浪费时间去修。

想要的结果

这是我想要的输入后的结果:

提前致谢!

打开Preferences -> Key Bindings-User并添加以下内容:

{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n\t[=10=]\n"}, "context":
    [
        { "key": "setting.auto_indent", "operator": "equal", "operand": true },
        { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
        { "key": "preceding_text", "operator": "regex_contains", "operand": "\($", "match_all": true },
        { "key": "following_text", "operator": "regex_contains", "operand": "^\)", "match_all": true }
    ]
}

如果文件之前为空,请在键绑定周围添加方括号 [ ] 并保存。如果文件有其他自定义键绑定,请将其粘贴在左括号 [ 之后的开头,并确保在其后添加逗号 , 以确保文件有效 JSON.