Skip to content

Commit

Permalink
Fix padding before colon when single digit
Browse files Browse the repository at this point in the history
  • Loading branch information
RadCod3 committed Feb 27, 2024
1 parent 92e0db6 commit bc654cc
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,15 @@ public String toString() {

int max_length_line = Math.max(lines.get(0).length(), lines.get(lines.size() - 1).length());
int n_digits_end = (int) Math.log10(startLineNumber + lines.size() - 1) + 1;
String padding = " ".repeat(n_digits_end + 1);
String paddingWithColon = " :" + " ".repeat(n_digits_end - 1);

String padding;
String paddingWithColon;
if (n_digits_end == 1) {
padding = " ".repeat(n_digits_end + 1);
paddingWithColon = ":" + " ".repeat(n_digits_end);
} else {
padding = " ".repeat(n_digits_end + 1);
paddingWithColon = " :" + " ".repeat(n_digits_end - 1);
}
int tabsInLastLine = countTabChars(lines.get(lines.size() - 1), this.endOffset);
lines.set(lines.size() - 1, replaceTabs(lines.get(lines.size() - 1), this.endOffset));
int maxLength = terminalWidth - n_digits_end - 3;
Expand Down

0 comments on commit bc654cc

Please sign in to comment.