Skip to content

Commit

Permalink
Add try_wrap function
Browse files Browse the repository at this point in the history
`try_wrap` is identical to `wrap` except that it returns the display widths of the wrapped lines rather than actually wrapping the given text. The tests are also borrowed from `wrap`'s.
  • Loading branch information
kkew3 committed Aug 28, 2024
1 parent 6397036 commit 6327567
Show file tree
Hide file tree
Showing 2 changed files with 515 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ mod options;
mod refill;
#[cfg(feature = "terminal_size")]
mod termwidth;
mod try_wrap;
mod word_separators;
mod wrap;

Expand All @@ -229,6 +230,7 @@ pub use options::Options;
pub use refill::{refill, unfill};
#[cfg(feature = "terminal_size")]
pub use termwidth::termwidth;
pub use try_wrap::try_wrap;
pub use word_separators::WordSeparator;
pub use word_splitters::WordSplitter;
pub use wrap::wrap;
Expand Down
Loading

0 comments on commit 6327567

Please sign in to comment.