Reflow the lines taking into account how long the ending brackets will be.

The ending brackets may go over the allowable maximum line length.
Therefore, we should consider the depth of the reflowing function so
that we can take the closing brackets into account when calculating if
an element can exist on the current line.