[英]How to make WebStorm automatically add new line and paste left indentation for braces
我想使WebStorm執行以下操作:
1)我正在JS對象中寫一個新屬性,它是一個對象常量:
const obj = {
a: 1,
b: {|} <-- caret is here and then I press Enter button
}
2)然后按Enter鍵,並希望看到以下圖片:
const obj = {
a: 1,
b: {
| <-- caret should be here
}
}
現在,我得到以下結果:
const obj = {
a: 1,
b: {
|} <-- caret is here
}
並且在關閉花括號后使其在一個空的JS文字對象內添加兩個空格也很酷
{ | } <-- caret here right after closing the brace
我找到了解決方法:轉到“設置”->“編輯器”->“常規”->“智能鍵”,然后打開“智能縮進”復選框
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.