From 55d002a4e749ee2945d2c436abc08bb15592fa8e Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Mon, 29 Aug 2016 11:31:43 +0200 Subject: [PATCH] endIndex simplified --- src/App/Fontifier.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App/Fontifier.hs b/src/App/Fontifier.hs index 05bbff2..7121da3 100644 --- a/src/App/Fontifier.hs +++ b/src/App/Fontifier.hs @@ -206,7 +206,7 @@ getWrite :: Int -> String -> Maybe (String, Slice, Bool) getWrite offset s = ((Tdfa.matchOnceText ยง~ "^(\\**[[:word:]]+)[[:blank:]]*=") s) >>= matchToA where matchToA (before, match, after) = let m = match ! 1 -- extract the match group (0 = the whole match) - in Just (fst m, (offset+(fst (snd m)), offset+(fst (snd m))+(snd (snd m))), False) + in Just (fst m, (offset+(fst (snd m)), offset+(length (fst m))), False) enterBlock :: [(String,Slice,Bool)] -> [(String,Slice,Bool)] enterBlock = map (\(v,s,b) -> ('*':v,s,b))