Don't apply indent on Enter after modifier list

#KT-9562 Fixed
This commit is contained in:
Dmitry Jemerov
2017-12-20 17:31:58 +01:00
parent 43ef113b7a
commit d69382f129
4 changed files with 16 additions and 0 deletions
@@ -237,6 +237,13 @@ abstract class KotlinCommonBlock(
}
}
if (newChildIndex > 0) {
val prevBlock = mySubBlocks?.get(newChildIndex - 1)
if (prevBlock?.node?.elementType == KtNodeTypes.MODIFIER_LIST) {
return ChildAttributes(Indent.getNoneIndent(), null)
}
}
return when (type) {
in CODE_BLOCKS, KtNodeTypes.WHEN, KtNodeTypes.IF, KtNodeTypes.FOR, KtNodeTypes.WHILE, KtNodeTypes.DO_WHILE -> ChildAttributes(Indent.getNormalIndent(), null)