From 8e241ef71d0e388c256da3926784f3dd287f4659 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 10 Feb 2017 16:43:57 -0500 Subject: [PATCH] Revert "Use O(1) length to find line ranges." This reverts commit 2c5ec5a3254ce88756ddc9312ff50cbdf884789d. --- src/Source.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Source.hs b/src/Source.hs index 1b71372ff..65ae8e8ae 100644 --- a/src/Source.hs +++ b/src/Source.hs @@ -91,7 +91,7 @@ actualLines source = case Source.break (== '\n') source of -- | Compute the line ranges within a given range of a string. actualLineRanges :: Range -> Source -> [Range] actualLineRanges range = drop 1 . scanl toRange (Range (start range) (start range)) . actualLines . slice range - where toRange previous source = Range (end previous) $ end previous + Source.length source + where toRange previous string = Range (end previous) $ end previous + Text.length (sourceText string) -- | Compute the character range given a Source and a SourceSpan. sourceSpanToRange :: Source -> SourceSpan -> Range