mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Fix single line if/else and loop indentation
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user