Commit ae024ee3 authored by Fredrik Wieczerkowski's avatar Fredrik Wieczerkowski
Browse files

Minor tweak to span preview bound check

parent efdabf7b
......@@ -88,7 +88,7 @@ ppSpanPreview (Span f (Position _ sl sc) (Position _ el ec))
fileContents <- readFile f
let lns = lines fileContents
lnContent | any (\l -> l <= 0 || l > length lns) [sl, el] = ""
lnContent | sl <= 0 || sl > length lns = ""
| otherwise = lns !! (sl - 1)
lnNum = text <$> lPadStr lnNumWidth <$> (vPad ++ [show sl] ++ vPad)
ec' = if isMultiline then length lnContent else ec
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment