easy-format icon indicating copy to clipboard operation
easy-format copied to clipboard

Easy format outputs no margins with width 68

Open charlesetc opened this issue 8 years ago • 5 comments

This is an edited version of simple_example.ml that prints the same thing 3 times, once with width 67, once with width 68, and once with width 69. https://gist.github.com/Charlesetc/42fdd7295bb364ae3ecd77ecc8a9da01

Here's the output: https://gist.github.com/Charlesetc/74388e8740ef2ac49d68c21d5451bd6b

You can see that the 68 version doesn't have the proper indentation. This was found here: https://github.com/facebook/reason/issues/446

What a funny bug!

charlesetc avatar Jul 17 '16 17:07 charlesetc

That's strange! Could you provide an OCaml version of the Reason program https://gist.github.com/Charlesetc/42fdd7295bb364ae3ecd77ecc8a9da01 ?

mjambon avatar Jul 18 '16 18:07 mjambon

I transformed that via the refmt program into OCaml via the following command:

curl https://gist.githubusercontent.com/Charlesetc/42fdd7295bb364ae3ecd77ecc8a9da01/raw/bd6632cc848260eb1844d5aedbab68c54f7bf688/breaking_margin.re | refmt -parse re -print ml -use-stdin true -is-interface-pp false

And it output:

https://gist.github.com/jordwalke/49e87326bce76f6e6fcf798f7bb5a50e

jordwalke avatar Jul 19 '16 22:07 jordwalke

Thanks @jordwalke - should've posted it in OCaml to start

charlesetc avatar Jul 21 '16 05:07 charlesetc

I am running into this as well, for now i have just setup a switch to change column width of 68 to 67, what a weird bug.

pieterv avatar Dec 28 '16 20:12 pieterv

Yeah, it's very hard to imagine what could be causing this!

jordwalke avatar Dec 28 '16 23:12 jordwalke