euporie.core.ft.utils.truncate

euporie.core.ft.utils.truncate(ft: StyleAndTextTuples, width: int, style: str = '', placeholder: str = '…', ignore_whitespace: bool = False) StyleAndTextTuples

Truncate all lines at a given length.

Parameters
  • ft – The formatted text to truncate

  • width – The width at which to truncate the text

  • style – The style to apply to the truncation placeholder. The style of the truncated text will be used if not provided

  • placeholder – The string that will appear at the end of a truncated line

  • ignore_whitespace – Do not use placeholder when truncating whitespace

Returns

The truncated formatted text