jtdaugherty / word-wrap

A Haskell library for wrapping long lines of text
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

ensure indent width is never greater than or equal to the target width #6

Closed callum-oakley closed 7 years ago

callum-oakley commented 7 years ago

I noticed while testing the last one that the corner case of having an indentation longer than the target width and having both of the settings True causes a negative lim, which then causes breakTokens to diverge.

There are probably other solutions to this problem, but ensuring the indent length is of length at most limit - 1 seemed like a good start.