easy-format
easy-format copied to clipboard
Cannot seem to use to_formatter within custom
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 ... *)
)
What are you expectations and what error are you getting?
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.