Skip to content

Conversation

Th3C0D3R
Copy link
Contributor

@Th3C0D3R Th3C0D3R commented Mar 7, 2025

I added the ability to break long strings into mutliple rows.
Default MaxWidth is 40 and Default Delimiter is Whitespace
Feel free to request any changes
I need this for me personally but saw someone asking for it.

How does it work:

  1. checked if the row contains any column longer than MaxWidth
  2. loop through Cells finding all cells with excess length
  3. split them into two parts at exactly the max width
  4. test if it was cut in the middle of a word (last character of the cut text and first character of the leftover text)
  5. if so, it searches for a whitespace before the cut text and cuts the original values again if one was found
  6. else it will be cut at MaxWidth (e.g URLs)
  7. a new row is added beneath the current row (this will ensure to check if the new content is still too long)

Things the user needs to keep in mind:
if there are Characters with UnicodeWidth longer than 1 it will look like this:

grafik

for me thats only because I parse data from the web and don't decode anything => user error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants