increment minimum marker position
[barcat.git] / barcat
diff --git a/barcat b/barcat
index 753e323a0ebe376109d38f4e5f3d444334e3eb92..efb631f248964c7714c4852ae6883c1668681a25 100755 (executable)
--- a/barcat
+++ b/barcat
@@ -287,6 +287,7 @@ my @barmark;
 if ($opt{markers} and $size > 0) {
        for my $markspec (split /\h/, $opt{markers}) {
                my ($char, $func) = split //, $markspec, 2;
+               my $increment = $func =~ s/[+]\z//;
                my @pos = eval {
                        if ($func eq 'avg') {
                                return sum(@order) / @order;
@@ -321,7 +322,8 @@ if ($opt{markers} and $size > 0) {
                        $pos -= $minval;
                        $pos &&= log $pos if $opt{log};
                        $pos >= 0 or next;
-                       color(36) for $barmark[$pos / $range * $size] = $char;
+                       $increment ||= $minval && !$pos;
+                       color(36) for $barmark[$pos / $range * $size + $increment] = $char;
                }
        }