| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -587,6 +587,7 @@ public String format(final String source) { | |||
| 587 | 587 | break; | |
| 588 | 588 | } | |
| 589 | 589 | ||
| 590 | + // In a simple enum, there's not necessarily a `;` to end the statement. | ||
| 590 | 591 | inStatementFlag = false; | |
| 591 | 592 | ||
| 592 | 593 | curlyLvl--; | |
@@ -606,6 +607,7 @@ public String format(final String source) { | |||
| 606 | 607 | ||
| 607 | 608 | trimRight(result); | |
| 608 | 609 | result.append('\n'); | |
| 610 | + overflowFlag = false; // Would normally be done in writeIndentedLine. | ||
| 609 | 611 | printIndentation(); | |
| 610 | 612 | result.append(c); | |
| 611 | 613 | if (peek() == ';') result.append(nextChar()); | |
@@ -728,10 +730,14 @@ else if (forFlag) { | |||
| 728 | 730 | inStatementFlag = false; | |
| 729 | 731 | arrayLevel = -1; // Unlikely to be needed; just in case. | |
| 730 | 732 | ||
| 731 | - //Same format for case, default, and other labels. | ||
| 732 | - tabs--; | ||
| 733 | - writeIndentedLine(); | ||
| 734 | - tabs++; | ||
| 733 | + // Same format for case, default, and other labels. | ||
| 734 | + if (tabs > 0) { | ||
| 735 | + tabs--; | ||
| 736 | + writeIndentedLine(); | ||
| 737 | + tabs++; | ||
| 738 | + } else { | ||
| 739 | + writeIndentedLine(); | ||
| 740 | + } | ||
| 735 | 741 | ||
| 736 | 742 | readForNewLine(); | |
| 737 | 743 | writeIndentedLine(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments