This library provides text-wrapping functionality.
- Line-wrapping now supports optional “filling”, i.e., placing prefix
strings at the start of wrapped lines. The behavior of filling is
configured by new
fillStrategy(what to add to filled lines) and
fillScope(which lines to affect with filling). Thanks to Brent Yorgey for this work!
- Fixed a bug that caused breakTokens to diverge for lines with
indentation longer than the indentation width when
preserveIndentation was enabled. (Thanks Callum Oakley.) The
resulting fix does the following:
- When breakLongWords is enabled, this change reduces the indentation of the indented lines to result in lines that are no longer than the wrap limit, so they will have reduced indentation and word fragments. This is a trade-off with other options that are open to evaluation.
- When breakLongWords is disabled, this change reduces the indentation of the indented lines and leaves whole words, unbroken, on them, resulting in lines that are longer than the indentation limit. This behavior is similar to non-indented lines with over-long tokens. This is also a trade-off with other options that are open to evaluation.
- Fixed a bug where each line was being wrapped after every word because only one case in breakTokens was reached (thanks Callum Oakley)
- Added a simple benchmark suite
- Fixed accidental breaking of long tokens when they could be wrapped instead.
- Fixed a bug that prevented wrapping sometimes.
- Fix inconsistent long token breaking (long tokens anywhere but the beginning of a line)
- Added the breakLongWords setting to WrapSettings. This setting makes it possible to cause words to get broken up over multiple lines if their lengths exceed the wrapping width.
- Added a WrapSettings data type for controlling wrapping behavior.
- All functions now require a WrapSettings.
- Added defaultWrapSettings for prior behavior.
- Wrap settings now include a setting to control how indentation is preserved in broken lines.
- Lines with only whitespace are preserved as empty lines.
- Fixed a bug where multiple consecutive newlines were not properly preserved as advertised (#2)
- Removed a duplicate mention of the changelog file in the cabal package description that used the wrong filename case (#1)
- First version.