From 0895fbf911f45a5a2a05bb8e790b6ecf39174f30 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Thu, 24 May 2018 22:20:52 +0000 Subject: [PATCH] Minimal diff context line number is 1, not 0, latter caused vector slice error --- src/Vervis/Widget/Repo.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Vervis/Widget/Repo.hs b/src/Vervis/Widget/Repo.hs index 20773f6..1b5b51b 100644 --- a/src/Vervis/Widget/Repo.hs +++ b/src/Vervis/Widget/Repo.hs @@ -119,7 +119,7 @@ addContext ctx orig = prepend . foldr f (undefined, []) ) prepend ((_ , _ ), []) = [] prepend ((startOld, startNew), l:ls) = - let o = max 0 $ startOld - ctx + let o = max 1 $ startOld - ctx len = min (startOld - o) ctx in (context orig o (startNew - len) len ++ l) : ls