mgeisler / textwrap

An efficient and powerful Rust library for word wrapping text.
MIT License
446 stars 44 forks source link

outdent: pad with trailing space to fixed with plus terminating characters #510

Open samliddicott opened 1 year ago

samliddicott commented 1 year ago

Please consider a feature where all lines are padded to the same length with spaces, and maybe trailing characters appended.

This means it easy to box text by using vertical box lines at either end of the line, especially in conjunction with #460

However boxing can be done externally if all lines are padded to the same width

samliddicott commented 1 year ago

Those outputting to terminal (and not to text file) can move the cursor to the right-column pad position $PAD_SIZE with:

tput el
tput cr
tput cuf ${PAD_SIZE}

and then emit whatever right-side bounding character they want