| ... | ... | @@ -532,14 +532,17 @@ const PrintNode = struct { |
| 532 | 532 | last: bool = false, |
| 533 | 533 | }; |
| 534 | 534 | |
| 535 | | fn printPrefix(node: *PrintNode, stderr: std.fs.File) !void { |
| 535 | fn printPrefix(node: *PrintNode, stderr: std.fs.File, ttyconf: std.debug.TTY.Config) !void { |
| 536 | 536 | const parent = node.parent orelse return; |
| 537 | 537 | if (parent.parent == null) return; |
| 538 | | try printPrefix(parent, stderr); |
| 538 | try printPrefix(parent, stderr, ttyconf); |
| 539 | 539 | if (parent.last) { |
| 540 | 540 | try stderr.writeAll(" "); |
| 541 | 541 | } else { |
| 542 | | try stderr.writeAll("│ "); |
| 542 | try stderr.writeAll(switch (ttyconf) { |
| 543 | .no_color, .windows_api => "| ", |
| 544 | .escape_codes => "\x1B\x28\x30\x78\x1B\x28\x42 ", // │ |
| 545 | }); |
| 543 | 546 | } |
| 544 | 547 | } |
| 545 | 548 | |
| ... | ... | @@ -552,14 +555,20 @@ fn printTreeStep( |
| 552 | 555 | step_stack: *std.AutoArrayHashMapUnmanaged(*Step, void), |
| 553 | 556 | ) !void { |
| 554 | 557 | const first = step_stack.swapRemove(s); |
| 555 | | try printPrefix(parent_node, stderr); |
| 558 | try printPrefix(parent_node, stderr, ttyconf); |
| 556 | 559 | |
| 557 | 560 | if (!first) try ttyconf.setColor(stderr, .Dim); |
| 558 | 561 | if (parent_node.parent != null) { |
| 559 | 562 | if (parent_node.last) { |
| 560 | | try stderr.writeAll("└─ "); |
| 563 | try stderr.writeAll(switch (ttyconf) { |
| 564 | .no_color, .windows_api => "+- ", |
| 565 | .escape_codes => "\x1B\x28\x30\x6d\x71\x1B\x28\x42 ", // └─ |
| 566 | }); |
| 561 | 567 | } else { |
| 562 | | try stderr.writeAll("├─ "); |
| 568 | try stderr.writeAll(switch (ttyconf) { |
| 569 | .no_color, .windows_api => "+- ", |
| 570 | .escape_codes => "\x1B\x28\x30\x74\x71\x1B\x28\x42 ", // ├─ |
| 571 | }); |
| 563 | 572 | } |
| 564 | 573 | } |
| 565 | 574 | |