Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot seem to use to_formatter within custom #22

Open
smondet opened this issue Feb 22, 2019 · 2 comments
Open

Cannot seem to use to_formatter within custom #22

smondet opened this issue Feb 22, 2019 · 2 comments

Comments

@smondet
Copy link

smondet commented Feb 22, 2019

I think it could be because of the call to flush
https://github.com/mjambon/easy-format/blob/master/src/easy_format.ml#L620

What I'm trying to do looks like:

custom (fun ppf ->
   (* .. bunch of pp_stuff ... *)
   List.iter a_few_easy_format_dot_ts ~f:(fun ef ->
      (* ... *)
     Easy_format.Pretty.to_formatter ppf ef
      (* ... *)
   ) ;
  (* ... more pp_stuff ... *)
)
@mjambon
Copy link
Member

mjambon commented Feb 22, 2019

What are you expectations and what error are you getting?

@smondet
Copy link
Author

smondet commented Feb 22, 2019

In the example above, I am expecting ef to be properly indented and formatted, but after the first one, they seem to show up non-indented and breaking "boxes" (that's why I think it is because of the call to Format.pp_print_flush).

If I replace Easy_format.Pretty.to_formatter ppf ef with fprintf ppf "random stuff" the same code seems to be correctly formatting the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants