TextBuffer.height

Sets the height (number of lines) for this TextBuffer.

Notes: TextBufferWriters will not automatically update their sizes to take into account this size change.

You will have to manually call TextBufferWriter.updateSize to reflect any changes, such as properly updating writers that use TextBuffer.USE_REMAINING_SPACE as one of their sizes.

Performance: As is a common theme with this class, it will try to reuse an internal buffer.

So if you're shrinking the height, no allocations should be made.

If you're growing the height, allocations are only made if the new height is larger than its ever been set to.

As a side effect, whenever you grow the buffer the data that occupies the new space will either be AnsiChar.init, or whatever was previously left there.

More...
  1. size_t height [@property getter]
  2. size_t height [@property setter]
    class TextBuffer
    @property nothrow
    void
    height
    (
    size_t lines
    )

Parameters

lines size_t

The new amount of lines.

Detailed Description

Side Effects

This function clears any cached output, so toStringNoDupe and toString will have to completely reconstruct the output.

Any TextBufferWriters with a non-dynamic size (e.g. no TextBuffer.USE_REMAINING_SPACE) that end up becoming out-of-bounds, will not be useable until they're remade, or until the height is changed again.

Any TextBufferRanges that exist prior to resizing are not affected in anyway, and can still access parts of the buffer that should now technically be "out of bounds" (in the event of shrinking).

Meta