File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/main/kotlin/org/domaframework/doma/intellij/formatter/block Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -41,11 +41,18 @@ open class SqlLiteralBlock(
4141 override fun setParentGroupBlock (lastGroup : SqlBlock ? ) {
4242 super .setParentGroupBlock(lastGroup)
4343 indent.indentLevel = IndentType .NONE
44- indent.indentLen = 0
45- indent.groupIndentLen = 0
44+ indent.indentLen = createBlockIndentLen()
45+ indent.groupIndentLen = createGroupIndentLen()
4646 }
4747
4848 override fun buildChildren (): MutableList <AbstractBlock > = mutableListOf ()
4949
5050 override fun isLeaf (): Boolean = true
51+
52+ override fun createBlockIndentLen (): Int =
53+ if (isFirstChildConditionLoopDirective() || isParentConditionLoopDirective()) {
54+ parentBlock?.indent?.indentLen ? : 0
55+ } else {
56+ 0
57+ }
5158}
You can’t perform that action at this time.
0 commit comments