IDEA自动关闭html格式

时间:2017-03-01 09:10:55

标签: intellij-idea

在html文件中,有一段javascript如:

{text: "EmployeeManagement", icon: "code", children: [
    {text: "HR", link: [[@{/employeeManage/hr.html}]]},
    {text: "Developer", link: [[@{/employeeManage/developer.html}]]},
]},

然而,一旦我放了

if(isEmployer) {
}
围绕它,它将以上代码格式化为:

if (isEmployer) {
                {
                    text: "EmployeeManagement", children
                :
                    [
                        {text: "HR", link: [[@{
                    /employeeManage
                    /hr.html
                }
                ]]
                },
                    {
                        text: "Developer", link
                    :
                        [[@{
                        /employeeManage
                        /developer.html
                    }
                    ]]
                    }

如何自动关闭此表格? 编辑:这是文件结构:

<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org">
<head>

    ....
</head>
<body data-module="app" style="overflow: hidden">
<div id="desktop"></div>
<script th:inline="javascript">
    /*<![CDATA[*/

    var isEmployer = ...

   ...
   {text: "EmployeeManagement", icon: "code", children: [
    {text: "HR", link: [[@{/employeeManage/hr.html}]]},
    {text: "Developer", link: [[@{/employeeManage/developer.html}]]},
   ]},
    ...

1 个答案:

答案 0 :(得分:2)

如果你不想有这种行为(我想是通过添加}),请转到

编辑 - &gt;一般 - &gt;智能钥匙并禁用选项Reformat block on typing }