diff --git a/lib/Patat/Presentation/Display.hs b/lib/Patat/Presentation/Display.hs index 298708f..cf7212c 100644 --- a/lib/Patat/Presentation/Display.hs +++ b/lib/Patat/Presentation/Display.hs @@ -158,9 +158,9 @@ dumpPresentation pres@Presentation {..} = dumpSlide i = do slide <- maybeToList $ getSlide i pres dumpComment slide <> L.intercalate ["{fragment}"] - [ dumpFragment (i, j) - | j <- [0 .. numFragments slide - 1] - ] + [ dumpFragment (i, j) + | j <- [0 .. numFragments slide - 1] + ] dumpComment :: Slide -> [PP.Doc] dumpComment slide = do @@ -186,16 +186,17 @@ dumpPresentation pres@Presentation {..} = -------------------------------------------------------------------------------- formatWith :: PresentationSettings -> PP.Doc -> PP.Doc -formatWith ps doc = wrap . indent $ - mconcat (replicate topMargin PP.hardline) <> doc +formatWith ps doc = + mconcat (replicate topMargin PP.hardline) <> + wrap (indent doc) where Margins {..} = margins ps - right = case mRight of - Auto -> error "auto" - NotAuto x -> x topMargin = case mTop of Auto -> error "auto" NotAuto x -> x + right = case mRight of + Auto -> error "auto" + NotAuto x -> x wrap = case (psWrap ps, psColumns ps) of (Just True, Just (A.FlexibleNum col)) -> PP.wrapAt (Just $ col - right) _ -> id diff --git a/tests/golden/inputs/margins.md b/tests/golden/inputs/margins.md index 5d0a59c..cf49fd1 100644 --- a/tests/golden/inputs/margins.md +++ b/tests/golden/inputs/margins.md @@ -1,4 +1,5 @@ --- +author: 'Jasper' patat: wrap: true columns: 57 # 10 + 42 + 5 diff --git a/tests/golden/outputs/margins.md.dump b/tests/golden/outputs/margins.md.dump index 62c2eae..265cfc0 100644 --- a/tests/golden/outputs/margins.md.dump +++ b/tests/golden/outputs/margins.md.dump @@ -1,5 +1,5 @@  margins.md  -  +  This text will have 10 spaces on the left.     - So