diff --git a/src/App/Fontifier.hs b/src/App/Fontifier.hs index b984c77..aec75e2 100644 --- a/src/App/Fontifier.hs +++ b/src/App/Fontifier.hs @@ -202,11 +202,11 @@ invAcc a i s@(c:t) = let writeAcc = getWrite i s in if isNothing writeAcc then if isNothing readAcc then invAcc a (i+1) t - else if isUnassigned (fromJust readAcc) a + else if isUnassigned (fromJust readAcc) a -- no assignment in rest str then (snd (fromJust readAcc)) : (invAcc a (i+1+readLen) (drop readLen t)) - else invAcc (markRead (fromJust readAcc) a) (i+1+readLen) (drop readLen t) -- no assignment in rest str TODO check for reads here + else invAcc (markRead (fromJust readAcc) a) (i+1+readLen) (drop readLen t) else invAcc (a ++ [fromJust writeAcc]) (i+1+matchLen) (drop matchLen t) -- assignment in accumStr, advance offset to end -invAcc a _ _ = map (\(_,s,_) -> s) a +invAcc a _ _ = [] getWrite :: Int -> String -> Maybe (String, Slice, Bool) getWrite offset s = ((Tdfa.matchOnceText ยง~ "^(\\**[[:word:]]+)[[:blank:]]*=") s) >>= matchToA @@ -238,7 +238,7 @@ leaveBlock = map (\(v,s,b) -> (tail v,s,b)) . filter (\(v,_,_) -> head v == '*') getUnread :: [(String,Slice,Bool)] -> Slices getUnread [] = [] getUnread ((v,s,b):ss) - | b = getUnread ss + | b || head v == '*' = getUnread ss | otherwise = s:getUnread ss {- General Fontification Utilities -}