fixes for ascii

This commit is contained in:
Branislav Stojkovic
2025-03-12 15:27:23 +01:00
parent c65ecc10bf
commit ede2a000d4
@@ -251,12 +251,20 @@ public class TreeAsciiUtil {
// Add separator after each element except the last // Add separator after each element except the last
if (i < elementLines.size() - 1) { if (i < elementLines.size() - 1) {
// If all elements have the same height, always use separator (for simple test case) // Only add separator on the center line
// Otherwise, use separator only on the center line (for original test case) if (line == centerLine) {
if (uniformHeight || line == centerLine) { // Check if the current element ends with a box character
sb.append(separator); String currentLine = sb.toString();
if (currentLine.endsWith(BOXDL) || currentLine.endsWith(BOXUL)) {
// If it ends with a box character, just add a single dash
sb.append(BOXH);
} else { } else {
sb.append(blankSeparator); // Otherwise add normal separator
sb.append(separator);
}
} else {
// Don't add any separator on non-center lines
sb.append(NBSP);
} }
} }
} }