charmbracelet / charmbracelet/x

ansi: right to left truncation option?

Open
#201 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
314
Forks
94
Avg merge
3d 22h
Merged PRs (30d)
2

Description

Right now, the `Truncate` function iterates over the given string from left to right. It might be nice to have either `TruncateRTL` or `DirectionalTruncate`

The left to right only option that we have now, can cause some issues with right-justified text or right-to-left languages (e.g. arabic)

Example:
" UK" becomes " U..."

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.