Skip to main content

Module utils

Module utils 

Source
Expand description

ANSI-aware text wrapping and width measurement.

Structs§

ActiveHyperlink
An active OSC 8 hyperlink tracked by AnsiCodeTracker.
AnsiCodeTracker
Tracks active ANSI SGR and OSC 8 state across line breaks.

Functions§

byte_index_at_visual_pos
Return the byte index in s that corresponds to visual position target_pos.
truncate_to_width
Truncate a string so its visible width does not exceed max_width.
visible_width
Compute the visible display width of a string.
wrap_text_with_ansi
Wrap text into lines that fit within width columns, preserving ANSI codes.