X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/ff4434f6c82a445f77ea5674f9fe4ec702e0e78a0c67c36ea9cfeacde87844c7..2f7a833204640ff60aa57cb577ffe5b32c8409e91acea52b4602d6e85b4d7a30:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index 70469f2..4673a69 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -4891,7 +4891,7 @@ sub print_sidebyside_diff_chunk { # empty contents block on start rem/add block, or end of chunk if (@ctx && (!$class || $class eq 'rem' || $class eq 'add')) { print join '', - '
', + '
', '
', @ctx, '
', @@ -4903,15 +4903,34 @@ sub print_sidebyside_diff_chunk { } # empty add/rem block on start context block, or end of chunk if ((@rem || @add) && (!$class || $class eq 'ctx')) { - print join '', - '
', - '
', - @rem, - '
', - '
', - @add, - '
', - '
'; + if (!@add) { + # pure removal + print join '', + '
', + '
', + @rem, + '
', + '
'; + } elsif (!@rem) { + # pure addition + print join '', + '
', + '
', + @add, + '
', + '
'; + } else { + # assume that it is change + print join '', + '
', + '
', + @rem, + '
', + '
', + @add, + '
', + '
'; + } @rem = @add = (); }