From: Mischa POSLAWSKY Date: Sat, 8 Apr 2017 02:40:43 +0000 (+0200) Subject: charset: compare option to indicate differences with parent X-Git-Tag: v1.10~216 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/92884d838c7e5fc4b9bd27043bf6f1054898b182?ds=sidebyside charset: compare option to indicate differences with parent --- diff --git a/charset.plp b/charset.plp index 5e16116..49ee2e7 100644 --- a/charset.plp +++ b/charset.plp @@ -323,6 +323,20 @@ for my $row (@request) { next; } + if (exists $get{compare}) { + state $visible = {}; + my $cp = $offset + $row->{offset}; + printf '%2$s', + $cp == ord $glyph ? 'l4' : + $row->{parent} && $glyph eq + Encode::decode($row->{parent}, pack 'C', $cp) ? 'l3' : + $visible->{$glyph} ? 'l2' : + 'l1', + $glyphs->glyph_html($glyph); + $visible->{$glyph}++; + next; + } + print "\n".$glyphs->glyph_cell($glyph); } continue {