Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bytes ¶
Bytes is shorthand for declaring a new default WordWrap instance, used to immediately word-wrap a byte slice.
Types ¶
type WordWrap ¶
type WordWrap struct { Limit int Breakpoints []rune Newline []rune KeepNewlines bool HardWrap bool TabReplace string // since tabs can have different lengths, replace them with this when hardwrap is enabled PreserveSpaces bool // contains filtered or unexported fields }
WordWrap contains settings and state for customisable text reflowing with support for ANSI escape sequences. This means you can style your terminal output without affecting the word wrapping algorithm.
func NewWriter ¶
NewWriter returns a new instance of a word-wrapping writer, initialized with default settings.
func (*WordWrap) Bytes ¶
Bytes returns the word-wrapped result as a byte slice. Make sure to have closed the WordWrapper, before calling it.
func (*WordWrap) Close ¶
Close will finish the word-wrap operation. Always call it before trying to retrieve the final result.
Click to show internal directories.
Click to hide internal directories.