class

Lipgloss::WrapWriter

Inherits Reference < Object

WrapWriter is a writer that writes to a buffer and keeps track of the current pen style and link state for the purpose of wrapping with newlines.

When it encounters a newline, it resets the style and link, writes the newline, and then reapplies the style and link to the next line.

Constructors

new(io : IO)

Returns a new WrapWriter.

Instance methods

close

Close closes the writer, resets the style and link if necessary, and releases its parser. Calling it is performance critical, but forgetting it does not cause safety issues or leaks.

style

Returns the current pen style.

write(p : Bytes) : Int32

Write writes to the buffer.

write(s : String) : Int32

Write writes a string to the buffer.