Skip to content

Commit d6b069c

Browse files
committed
Fix hunk header count when trailing context lines a present.
1 parent 8b63165 commit d6b069c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xtra/DIFF.LUA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ local function diff_u(fn1,fn2)
3030
local function pfl(p,s)return(p..s:gsub('\n$',''):gsub('\r$',''))end
3131
local i,j,u=1,1
3232
local function flush()if #u.l>0 then
33-
if u.e==4 then table.remove(u.l)end
33+
if u.e==4 then table.remove(u.l)u.o.l,u.n.l=u.o.l-1,u.n.l-1 end
3434
table.insert(u.l,1,"@@ -"..u.o.s..(u.o.l==1 and""or","..u.o.l).." +"..u.n.s..(u.n.l==1 and""or","..u.n.l).. " @@")
3535
if not fh then
3636
local function fn(s)return string.match(s,"%s")and '"'..s..'"'or s end

0 commit comments

Comments
 (0)