Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Widest for returning the widest member of a string slice #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

meowgorithm
Copy link
Member

An additional utility function. Not totally sure if this should be merged yet, but I find myself doing this a lot.

@meowgorithm meowgorithm added the enhancement New feature or request label Oct 2, 2023
@maaslalani
Copy link
Contributor

I think this should probably go in charmbracelet/x.

@maaslalani
Copy link
Contributor

maaslalani commented Mar 14, 2024

@aymanbagabas What do you think about making an ANSI-aware function of this in x/term? I also found myself needing this at some points.

@aymanbagabas
Copy link
Member

@aymanbagabas What do you think about making an ANSI-aware function of this in x/term? I also found myself needing this at some points.

Hey @maaslalani, this PR updates the Width method to use ansi.StringWidth to calculate the width. However I still think something like lipgloss.Widest is still beneficial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants