Skip to content

Commit

Permalink
[tuify] Make text clipping function pub, so other crates can use it, …
Browse files Browse the repository at this point in the history
…eg: r3bl_terminal_async
  • Loading branch information
nazmulidris committed Apr 15, 2024
1 parent 8c9f995 commit fccf70e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tuify/src/components/select_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ impl<W: Write> FunctionComponent<W, State<'_>> for SelectComponent<W> {
}
}

fn clip_string_to_width_with_ellipsis(mut header_text: String, viewport_width: ChUnit) -> String {
pub fn clip_string_to_width_with_ellipsis(
mut header_text: String,
viewport_width: ChUnit,
) -> String {
let unicode_string = UnicodeString::from(header_text);
let unicode_string_width = unicode_string.display_width;
let available_space_col_count: ChUnit = viewport_width;
Expand Down

0 comments on commit fccf70e

Please sign in to comment.