From 3403f8d75bd4de6199b51c4c8637b9ea57d435aa Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Sun, 16 Dec 2018 11:30:50 -0800 Subject: [PATCH] Fix bug in overlap check --- src/ShellCheck/Fixer.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ShellCheck/Fixer.hs b/src/ShellCheck/Fixer.hs index 1cabb1e..52a991c 100644 --- a/src/ShellCheck/Fixer.hs +++ b/src/ShellCheck/Fixer.hs @@ -20,9 +20,10 @@ applyFix fix fileLines = if overlap x y then x:(removeOverlap ys) else x:y:(removeOverlap ys) -- two position overlaps when overlap x y = - (yStart >= xStart && yStart <= xEnd) || (yStart < xStart && yStart > xStart) + (yStart >= xStart && yStart < xEnd) || (yStart < xStart && yEnd > xStart) where yStart = repStartPos y + yEnd = repEndPos y xStart = repStartPos x xEnd = repEndPos x