about summary refs log tree commit homepage
path: root/lib/PublicInbox/ViewDiff.pm
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2020-05-09 18:57:46 +0000
committerEric Wong <e@yhbt.net>2020-05-09 19:32:11 +0000
commitc8e8c8107913df9c67c5eeee86d20f633d11a6d4 (patch)
tree9a230f15d797c212e498adf8ac540624d1fdf694 /lib/PublicInbox/ViewDiff.pm
parentb2f2d28e20f7bf9e7234d3134ec91cd9549001b1 (diff)
downloadpublic-inbox-c8e8c8107913df9c67c5eeee86d20f633d11a6d4.tar.gz
For a diff hunk starting at line N, diff_hunk() constructs the link
with "#n(N + 1)".  This sends the viewer one line below the first
context line.  Although this is minor and may not even be noticed,
there's not an obvious reason to increment the line number, so switch
to using the reported value as is.
Diffstat (limited to 'lib/PublicInbox/ViewDiff.pm')
-rw-r--r--lib/PublicInbox/ViewDiff.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/ViewDiff.pm b/lib/PublicInbox/ViewDiff.pm
index 6fe9a0d7..536bb9e3 100644
--- a/lib/PublicInbox/ViewDiff.pm
+++ b/lib/PublicInbox/ViewDiff.pm
@@ -50,12 +50,12 @@ sub diff_hunk ($$$$) {
 
         if (defined($spfx) && defined($oid_a) && defined($oid_b)) {
                 my ($n) = ($ca =~ /^-([0-9]+)/);
-                $n = defined($n) ? do { ++$n; "#n$n" } : '';
+                $n = defined($n) ? "#n$n" : '';
 
                 $$dst .= qq(@@ <a\nhref="$spfx$oid_a/s/$dctx->{Q}$n">$ca</a>);
 
                 ($n) = ($cb =~ /^\+([0-9]+)/);
-                $n = defined($n) ? do { ++$n; "#n$n" } : '';
+                $n = defined($n) ? "#n$n" : '';
                 $$dst .= qq( <a\nhref="$spfx$oid_b/s/$dctx->{Q}$n">$cb</a> @@);
         } else {
                 $$dst .= "@@ $ca $cb @@";