We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f238062 commit 08f6249Copy full SHA for 08f6249
xtra/DIFF.LUA
@@ -35,7 +35,8 @@ local function diff_u(fn1,fn2)
35
local function fn(s)return string.match(s,"%s")and '"'..s..'"'or s end
36
table.insert(u.l,1,"+++ "..fn(fn2))table.insert(u.l,1,"--- "..fn(fn1))fh=true end
37
for _,v in ipairs(u.l) do print(v)end end u=nil end
38
- local function init()if not u then u={e=0,l={},o={s=i,l=0},n={s=j,l=0}}end end
+ local function init()if not u then local k,l=math.max(i-3,1),math.max(j-3,1)u={e=0,l={},o={s=k,l=0},n={s=l,l=0}}
39
+ for z=k,i-1 do table.insert(u.l,pfl(" ",get(fn1,f1,z)))u.o.l,u.n.l=u.o.l+1,u.n.l+1 end end end
40
for _,p in ipairs(path)do
41
while i<p.x do init()table.insert(u.l,pfl("-",get(fn1,f1,i)))i,u.o.l,u.e=i+1,u.o.l+1,0 end
42
while j<p.y do init()table.insert(u.l,pfl("+",get(fn2,f2,j)))j,u.n.l,u.e=j+1,u.n.l+1,0 end
0 commit comments