Format: When is there "no more room on a line"

I’ve been reading OCaml library : Format_tutorial to understand some finer details.

The documentation says in a few places “break hints are used to cut the line when there is no more room on the line”.

How does Format know when there is no more room on the line? I’m printing some stuff on the terminal. I’m trying to change the width of the terminal on my desktop, trying to set the terminal width by using stty cols 40 etc. but I always get stuff on one line for normal box, hov box, hv box.

How do I tell Format what width it should assume for a line?

Set the right margin with Format.set_margin.

1 Like