Skip to content

Commit

Permalink
Fix regression for spacing around else keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbosch committed Jun 7, 2017
1 parent 468dcd4 commit adbbc3d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class SpacingAroundKeywordRule : Rule("keyword-spacing") {
node.nextLeaf()?.delete()
}
}
} else if (noLFBeforeSet.contains(node.elementType)) {
}
if (noLFBeforeSet.contains(node.elementType)) {
val prevLeaf = PsiTreeUtil.prevLeaf(node)
if (prevLeaf is PsiWhiteSpaceImpl && prevLeaf.textContains('\n') &&
(node.elementType != ELSE_KEYWORD || node.parent !is KtWhenEntry) &&
Expand Down

0 comments on commit adbbc3d

Please sign in to comment.