bugfix for do clause

This commit is contained in:
neoe 2018-03-22 10:15:18 +08:00
parent d5330b6956
commit 416f9c5462
2 changed files with 10 additions and 4 deletions

BIN
dist/luaformatter.jar vendored

Binary file not shown.

View File

@ -249,6 +249,14 @@ public class LuaFormatter {
printIndent();
changedLine = 0;
sb.append(token);
} else if ("do".equals(token)) {
if (changedLine > 0) {
printIndent();
changedLine = 0;
}
sb.append(token);
incIndent(token);
changeLine();
} else {
if (changedLine > 0) {
printIndent();
@ -262,12 +270,10 @@ public class LuaFormatter {
incIndent(token);
} else if ("while".equals(token)) {
loop(type, "do", null);
incIndent(token);
changeLine();
} else if ("for".equals(token)) {
loop(type, "do", null);
incIndent(token);
changeLine();
} else if ("if".equals(token)) {
loop(type, "then", null);
incIndent(token);