From ede2a000d49fb11cb0e8599d5126b68543197e66 Mon Sep 17 00:00:00 2001 From: Branislav Stojkovic Date: Wed, 12 Mar 2025 15:27:23 +0100 Subject: [PATCH] fixes for ascii --- .../java/org/diylc/netlist/TreeAsciiUtil.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/diylc/diylc-core/src/main/java/org/diylc/netlist/TreeAsciiUtil.java b/diylc/diylc-core/src/main/java/org/diylc/netlist/TreeAsciiUtil.java index 0db1b4b1..f1f0166f 100644 --- a/diylc/diylc-core/src/main/java/org/diylc/netlist/TreeAsciiUtil.java +++ b/diylc/diylc-core/src/main/java/org/diylc/netlist/TreeAsciiUtil.java @@ -251,13 +251,21 @@ public class TreeAsciiUtil { // Add separator after each element except the last if (i < elementLines.size() - 1) { - // If all elements have the same height, always use separator (for simple test case) - // Otherwise, use separator only on the center line (for original test case) - if (uniformHeight || line == centerLine) { - sb.append(separator); - } else { - sb.append(blankSeparator); - } + // Only add separator on the center line + if (line == centerLine) { + // Check if the current element ends with a box character + 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 { + // Otherwise add normal separator + sb.append(separator); + } + } else { + // Don't add any separator on non-center lines + sb.append(NBSP); + } } }