batterseapower / ansi-wl-pprint

The Wadler/Leijen Pretty Printer for colored ANSI terminal output
http://batterseapower.github.com/ansi-wl-pprint
Other
30 stars 15 forks source link

Add priority to soft-breaks #8

Open ilya-epifanov opened 10 years ago

ilya-epifanov commented 10 years ago

e.g.:

in

"a" </> "+" </> + "b" </> " = " </> "c" </> "/" </> "d"

one of the soft breaks around equals sign should have higher priority, so that

a + b
= c / d

or

a + b =
c / d

is printed instead of

a + b = c
/ d
ilya-epifanov commented 10 years ago

IMO, the best looking solution would be

("a" </> "+" </> + "b") </> " = " </> ("c" </> "/" </> "d")

which should mean that both spaces around equals sign have high priority, but soft breaks within expression can still trigger nevertheless.

hvr commented 9 years ago

please migrate to https://github.com/ekmett/ansi-wl-pprint/issues