mirror of
https://github.com/Microsoft/vscode
synced 2024-10-01 08:50:48 +00:00
Fix single line if/else and loop indentation
This commit is contained in:
parent
2260d7cca3
commit
16f501ee33
|
@ -76,6 +76,15 @@
|
|||
"indent": "none",
|
||||
"removeText": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
// Decrease indentation after single line if/else if/else, for, foreach, or while
|
||||
"previousLineText": "^\\s*(((else ?)?if|for(each)?|while)\\s*\\(.*\\)\\s*|else\\s*)$",
|
||||
// But make sure line doesn't have braces or is not another if statement
|
||||
"beforeText": "^\\s+([^{i\\s]|i(?!f\\b))",
|
||||
"action": {
|
||||
"indent": "outdent"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -188,6 +188,15 @@
|
|||
"action": {
|
||||
"indent": "indent"
|
||||
}
|
||||
},
|
||||
{
|
||||
// Decrease indentation after single line if/else if/else, for, or while
|
||||
"previousLineText": "/^\\s*(((else )?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$/",
|
||||
// But make sure line doesn't have braces or is not another if statement
|
||||
"beforeText": "/^\\s+([^{i\\s]|i(?!f\\b))/",
|
||||
"action": {
|
||||
"indent": "indentOutdent"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue