on master help sign in
layoutSource returns Doc
commit6e98ac176fdda5188e70ef858682393907bb172b authorJason Felice <jason.m.felice@gmail.com> dateWed 6 Dec 2017, 10:09 (9 years ago) parentabc6b5c
1 file changed+3−3
src/Idris/Output.hs+3−3
src/Idris/Output.hs+3−3
@@ -60,7 +60,7 @@ iWarn fc err =
6060 do maybeSource <- readSource fc
6161 let maybeFormattedSource = (maybeSource >>= layoutSource fc)
6262 err' <- iRender . fmap (fancifyAnnots i True) $
63− layoutWarning (layoutFC fc) (fmap string maybeFormattedSource) err
63+ layoutWarning (layoutFC fc) maybeFormattedSource err
6464 hWriteDoc h i err'
6565 IdeMode n h ->
6666 do err' <- iRender . fmap (fancifyAnnots i True) $ err
@@ -80,10 +80,10 @@ iWarn fc err =
8080 Right v -> pure (Just v)
8181 readSource _ = pure Nothing
8282
83− layoutSource :: FC -> String -> Maybe String
83+ layoutSource :: FC -> String -> Maybe OutputDoc
8484 layoutSource (FC fn (si, sj) (ei, ej)) src =
8585 if isJust sourceLine
86− then Just (top ++ "\n" ++ formattedLine ++ "\n" ++ bottom)
86+ then Just . string $ top ++ "\n" ++ formattedLine ++ "\n" ++ bottom
8787 else Nothing
8888 where
8989 sourceLine = listToMaybe . drop (si - 1) . lines $ src