lib: Hledger.Utils.IO: avoid excessively wide "compact" prettyprinting
This commit is contained in:
parent
76f336695c
commit
83de76b67a
@ -126,18 +126,20 @@ import Hledger.Utils.Text (WideBuilder(WideBuilder))
|
|||||||
|
|
||||||
-- Pretty showing/printing with pretty-simple
|
-- Pretty showing/printing with pretty-simple
|
||||||
|
|
||||||
|
-- https://hackage.haskell.org/package/pretty-simple/docs/Text-Pretty-Simple.html#t:OutputOptions
|
||||||
|
|
||||||
-- | pretty-simple options with colour enabled if allowed.
|
-- | pretty-simple options with colour enabled if allowed.
|
||||||
prettyopts =
|
prettyopts =
|
||||||
(if useColorOnStderr then defaultOutputOptionsDarkBg else defaultOutputOptionsNoColor)
|
(if useColorOnStderr then defaultOutputOptionsDarkBg else defaultOutputOptionsNoColor)
|
||||||
{ outputOptionsIndentAmount=2
|
{ outputOptionsIndentAmount = 2
|
||||||
, outputOptionsCompact=True
|
-- , outputOptionsCompact = True -- fills lines, but does not respect page width (https://github.com/cdepillabout/pretty-simple/issues/126)
|
||||||
|
-- , outputOptionsPageWidth = fromMaybe 80 $ unsafePerformIO getTerminalWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | pretty-simple options with colour disabled.
|
-- | pretty-simple options with colour disabled.
|
||||||
prettyopts' =
|
prettyopts' =
|
||||||
defaultOutputOptionsNoColor
|
defaultOutputOptionsNoColor
|
||||||
{ outputOptionsIndentAmount=2
|
{ outputOptionsIndentAmount=2
|
||||||
, outputOptionsCompact=True
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-- | Pretty show. Easier alias for pretty-simple's pShow.
|
-- | Pretty show. Easier alias for pretty-simple's pShow.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user