utils

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TruncateToLines

func TruncateToLines(text string, maxLines int, maxWidth int) string

TruncateToLines truncates text to a maximum number of lines with proper word wrapping. The last line will be truncated with "..." if it exceeds the limit.

func TruncateWithWidth

func TruncateWithWidth(text string, maxWidth int) string

TruncateWithWidth truncates text to fit within maxWidth, accounting for Unicode character widths. Adds "..." if the text is truncated.

func WrapText

func WrapText(text string, maxWidth int) []string

WrapText wraps text at word boundaries to fit within maxWidth. Returns a slice of lines.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL