alot icon indicating copy to clipboard operation
alot copied to clipboard

Support wrapping column text over multiple lines

Open brandonpayton opened this issue 2 years ago • 1 comments

This PR adds text wrapping for regular text fields to help address issue #1418.

It adds text wrapping support for thread parts like authors, subject, and content but not for tags.

To make a thread part wrappable, use the following config:

# width = 'wrap', min-width, max-width, min-lines, max-lines
width = 'wrap', 40, 40, 2, 2

This results in thread lines like: alot-wrapping-example

A few notes:

  1. The new tuple validation in configobj takes the same form as proposed in #1633.
  2. For readability, it seems like it would be good to support textwrap.wrap()'s initial_indent and subsequent_indent arguments to better delineate the start of wrapped parts and their subsequent lines, but for the sake of simplicity, that is left for a follow-up PR.
  3. These changes do not yet include documentation updates, but I am happy to add those here or in a later PR if this feature addition looks good to you.

brandonpayton avatar Nov 25 '23 03:11 brandonpayton

I added some missing docs, rebased to incorporate width_tuple validation updates, and added more configobj tests. I think this is ready for review.

brandonpayton avatar Nov 27 '23 20:11 brandonpayton