1
0
Fork 0
mirror of https://code.sup39.dev/repos/Wqawg synced 2024-12-31 04:54:51 +09:00

Minimal diff context line number is 1, not 0, latter caused vector slice error

This commit is contained in:
fr33domlover 2018-05-24 22:20:52 +00:00
parent 7d237b7540
commit 0895fbf911

View file

@ -119,7 +119,7 @@ addContext ctx orig = prepend . foldr f (undefined, [])
) )
prepend ((_ , _ ), []) = [] prepend ((_ , _ ), []) = []
prepend ((startOld, startNew), l:ls) = prepend ((startOld, startNew), l:ls) =
let o = max 0 $ startOld - ctx let o = max 1 $ startOld - ctx
len = min (startOld - o) ctx len = min (startOld - o) ctx
in (context orig o (startNew - len) len ++ l) : ls in (context orig o (startNew - len) len ++ l) : ls