@@ -1088,12 +1088,13 @@ std::shared_ptr<FormatElement> LuaFormatter::FormatIfStatement(std::shared_ptr<L
10881088 }
10891089
10901090 env->AddChild (FormatExpression (child, expression));
1091- env->Add <KeepBlankElement >(1 );
1091+ env->Add <KeepElement >(1 );
10921092 break ;
10931093 }
10941094 default :
10951095 {
10961096 DefaultHandle (child, env);
1097+ env->Add <KeepElement>(1 );
10971098 break ;
10981099 }
10991100 }
@@ -1196,6 +1197,10 @@ std::shared_ptr<FormatElement> LuaFormatter::FormatCallArgList(std::shared_ptr<L
11961197 layout = std::make_shared<AlignToFirstElement>();
11971198 }
11981199 }
1200+ else
1201+ {
1202+ layout = std::make_shared<IndentOnLineBreakElement>();
1203+ }
11991204
12001205 env->AddChild (FormatExpressionList (child, layout));
12011206 env->Add <KeepElement>(0 );
@@ -1803,7 +1808,7 @@ std::shared_ptr<FormatElement> LuaFormatter::FormatNodeAndBlockOrEnd(LuaAstNode:
18031808 else
18041809 {
18051810 singleLineBlock = true ;
1806- env->Add <KeepBlankElement >(1 );
1811+ env->Add <KeepElement >(1 );
18071812
18081813 for (auto blockChild : block->GetChildren ())
18091814 {
@@ -1812,7 +1817,7 @@ std::shared_ptr<FormatElement> LuaFormatter::FormatNodeAndBlockOrEnd(LuaAstNode:
18121817 auto shortExpression = std::make_shared<ExpressionElement>();
18131818 shortExpression->AddChildren (blockChild->GetChildren ());
18141819 env->AddChild (shortExpression);
1815- env->Add <KeepBlankElement >(1 );
1820+ env->Add <KeepElement >(1 );
18161821 }
18171822 }
18181823 }
0 commit comments