charset: assume parent visibility
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 8 Apr 2017 01:08:48 +0000 (03:08 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 24 Apr 2017 23:51:41 +0000 (01:51 +0200)
Hack to hide indirect parents, usually related iso numbers.

charset.plp

index 309139e..9d7375d 100644 (file)
@@ -137,18 +137,21 @@ sub tabinput {
 
                my @parents = @{ $INHERIT->{$input} || [] };
 
-               if (my ($parent, $part) = pairfirst { $visible->{$a} } @parents) {
+               if (my ($parent, $part) = pairfirst { exists $visible->{$a} } @parents) {
                        $row{parent} = $parent;
                        $params = $part;
+                       $_ eq $part or $params = 128 for $visible->{$parent} // ();
                }
-               elsif ($visible->{ascii}) {
-                       $row{parent} = $parents[0] || 'ascii';
+               elsif (exists $visible->{ascii}) {
+                       $row{parent} = $parents[0];
                        $params = $parents[1] || 128;
+                       exists $visible->{$_} or $visible->{$_} = $params for $row{parent};
                        $params = 128 if $params >= 128;  # ascii offset at most
                }
                elsif (@parents) {
                        $row{parent} = $parents[0];
                }
+                       exists $visible->{$_} or $visible->{$_} = $params // 0 for $row{parent};
        }
 
        if (defined $params and $params =~ m/^ (\d+) (-\d+)? /x) {
@@ -209,7 +212,7 @@ sub tabinput {
                        }
 
                        $visible->{ascii} =  # assume common base
-                       $visible->{ $row{set} } = 1;
+                       $visible->{ $row{set} } = undef;
                }
        }
        else {