git.shiar.nl
/
sheet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b37bf3b
)
charset: unabbreviated row labels if misaligned
author
Mischa POSLAWSKY
<perl@shiar.org>
Thu, 6 Apr 2017 19:14:25 +0000
(21:14 +0200)
committer
Mischa POSLAWSKY
<perl@shiar.org>
Mon, 24 Apr 2017 23:51:42 +0000
(
01:51
+0200)
charset.plp
patch
|
blob
|
history
diff --git
a/charset.plp
b/charset.plp
index db178d9bfb383514a2c6e51a97cbf28b6081b9dc..28c21c985c4e36ecb2c808ae7a6a029fd444b593 100644
(file)
--- a/
charset.plp
+++ b/
charset.plp
@@
-161,7
+161,8
@@
for my $row (@request) {
my $cols = $row->{cols};
my $colsize = $row->{cell} && $row->{cell}->{colsize} || 1;
my $coldigits = ceil(log($colsize * $cols) / log(16)); # uniform length of hexadecimal header
my $cols = $row->{cols};
my $colsize = $row->{cell} && $row->{cell}->{colsize} || 1;
my $coldigits = ceil(log($colsize * $cols) / log(16)); # uniform length of hexadecimal header
- my $rowdiv = 16 ** $coldigits; # divider of row headers
+ my $rowdiv = 16 ** $coldigits; # row divide for column digits
+ $rowdiv = 1 if $rowdiv != $cols * $colsize; # divide only if all columns are matched
my $offset = 0;
my $endpoint = $offset + (length($row->{table}) || 256) * $colsize;
my $offset = 0;
my $endpoint = $offset + (length($row->{table}) || 256) * $colsize;
@@
-171,7
+172,7
@@
for my $row (@request) {
printf '<caption>%s</caption>', $title;
print '<col>' x ($cols + 1);
for my $section (qw{thead}) {
printf '<caption>%s</caption>', $title;
print '<col>' x ($cols + 1);
for my $section (qw{thead}) {
- print "<$section><tr><th>
↱"
;
+ print "<$section><tr><th>
", $rowdiv == 1 ? '+' : '↱'
;
printf '<th>%0*X', $coldigits, $_ * $colsize for 0 .. $cols - 1;
print "\n";
}
printf '<th>%0*X', $coldigits, $_ * $colsize for 0 .. $cols - 1;
print "\n";
}