Phillip Wood <phillip.w...@talktalk.net> writes:

> +sub label_hunk_lines {
> +     my $hunk = shift;
> +     my $text = $hunk->{TEXT};
> +     my (@line_flags, @lines);
> +     my ($block, $label, $last_mode) = (0, 0, '');
> +     for my $line (1..$#{$text}) {

$text is a ref to an array so @$text is the whole thing, $#{$text}
is the index of the last item in that array, and $text->[0] is the
first element of that array.  This for loop runs with $line == 1
thru $line == $#{$text}, so we are somehow excluding the very first
element?

> +             $line_flags[$line] = 0;
> +             my $mode = substr($text->[$line], 0, 1);
> +             if ($mode eq '\\') {
> +                     $line_flags[$line - 1] |= NO_NEWLINE;
> +             }
> +             if ($mode eq '-' or $mode eq '+') {
> +                     $lines[++$label] = $line;
> +             }
> +     }
> +     if ($label > 1) {

Reply via email to