Skip to content

Commit a6dc15c

Browse files
committed
fix: Fix console rendering when width < 140
1 parent e59e0eb commit a6dc15c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/java/dev/dochia/cli/core/util/ConsoleUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ public static void renderNewRow(String path, char progress) {
167167
*/
168168
public static void renderRow(String prefix, String path, char progressChar) {
169169
String withoutAnsi = ANSI_REMOVE_PATTERN.matcher(path).replaceAll("");
170-
int dots = Math.max(terminalWidth - withoutAnsi.length() - 2, 1);
170+
int dots = Math.max(terminalWidth - withoutAnsi.length() - 4, 1);
171171
String firstPart = " ".repeat(3) + path.substring(0, path.indexOf(SEPARATOR));
172-
String secondPart = path.substring(path.indexOf(SEPARATOR) + 1);
172+
String secondPart = path.substring(path.indexOf(SEPARATOR) + SEPARATOR.length());
173173
String toPrint = AnsiUtils.bold(prefix + firstPart + " " + ".".repeat(dots) + secondPart + " " + progressChar);
174174

175175
//we just use system.out as the logger adds a new line

0 commit comments

Comments
 (0)