zhiburt / tabled

An easy to use library for pretty print tables of Rust structs and enums.
MIT License
1.94k stars 77 forks source link

Set word delimiter for Wrap's `keep_words` #400

Open fmorroni opened 5 months ago

fmorroni commented 5 months ago

I want to wrap some long paths I have in my table. The keep_words method seems to only detect spaces as word delimiters. Is it posible to set a custom delimiter? I would like to set it as / for example so the paths are wrapped only at directories.

zhiburt commented 5 months ago

Hi @fmorroni

Interesting issue.

So yes it's possible, to do, I guess.

Need to test

zhiburt commented 5 months ago

Though it will be applied to the whole table. Which is not good.

I mean we need to be able to set delimeter per target (column/row/cell etc.). Which will make thinks complex.

Need to think maybe there's a better solution here.

fmorroni commented 5 months ago

I see, for my use case a global setting would be fine. But yeah I guess ideally you should be able to set the delimiter per target.