Skip to content

Commit cc0e504

Browse files
committed
fix grid formatting for labelled boxed scalars
1 parent 4f2917a commit cc0e504

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/grid_fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ impl GridFmt for Boxed {
554554
for row in &mut grid {
555555
row.insert(0, ' ');
556556
}
557-
grid[(height - 1) / 2][0] = symbol;
557+
grid[height / 2][0] = symbol;
558558
}
559559
}
560560
}

tests/grid.ua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,18 @@ $ ┘
7575
⍤⤙≍ ¤"[\"1\"│]" pretty {"1"}
7676
⍤⤙≍ ¤"[¤\"1\"│]" pretty {¤"1"}
7777
⍤⤙≍ ¤"[¤\"23\"│]" pretty {¤"23"}
78+
79+
# Labels
80+
pretty {$a 5 $b 6}
81+
$ ┌─
82+
$ a│ b
83+
$ ∙5│∙6
84+
$ ┘
85+
⍤⤙≍ ⊜∘⊸≠@\n
86+
87+
pretty {$a 5 $b @x}
88+
$ ┌─
89+
$ a│b
90+
$ ∙5│@x
91+
$ ┘
92+
⍤⤙≍ ⊜∘⊸≠@\n

0 commit comments

Comments
 (0)