Skip to content
Miscellaneous functions for formatting text
Go
Find file
Latest commit bb797dc Sep 5, 2015 @kr text: fix infinite loop in Wrap
If the last word is greater than the limit, we wouldn't
set the next line break at all, and it would be left at
0, causing an infinite loop in the final loop to apply
the line breaks.

To fix this, recognize that the last word must be on the
last line, so its length doesn't matter. Always set the
last word's next break to the end of the text.

Fixes #1.
Closes #2.

Readme

This is a Go package for manipulating paragraphs of text.

See http://go.pkgdoc.org/github.com/kr/text for full documentation.
Something went wrong with that request. Please try again.