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

fix(text_prompt): use unicode-width instead of char cnt #46

Merged
merged 1 commit into from May 11, 2024

Conversation

kxxt
Copy link
Contributor

@kxxt kxxt commented May 11, 2024

The cursor position is not correct when there are emojis in the prompt(See the picture below). This PR fixes it by using unicode-width.

image

The cursor position is not correct when there are emojis in the prompt.
This PR fixes it by using unicode-width.
kxxt added a commit to kxxt/tracexec that referenced this pull request May 11, 2024
The cursor position is not correct, which need to be fixed in upstream dependency: joshka/tui-prompts#46
kxxt added a commit to kxxt/tracexec that referenced this pull request May 11, 2024
The cursor position is not correct, which need to be fixed in upstream dependency: joshka/tui-prompts#46
Copy link
Owner

@joshka joshka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@joshka joshka merged commit 5a8e9b5 into joshka:main May 11, 2024
10 of 11 checks passed
@kxxt
Copy link
Contributor Author

kxxt commented May 11, 2024

LGTM

Hi, @joshka on a second thought I think there's no need to depend on unicode-width at all. Line exposes a width method already so there's no need to convert it to a string to measure its width. I am currently away from my computer. Maybe you can fix it directly since this PR is already merged. And because this bug impacts my application, I would appreciate a new release/prerelease of tui-prompts. Thanks in advance!

@kxxt
Copy link
Contributor Author

kxxt commented May 11, 2024

LGTM

Hi, @joshka on a second thought I think there's no need to depend on unicode-width at all. Line exposes a width method already so there's no need to convert it to a string to measure its width. I am currently away from my computer. Maybe you can fix it directly since this PR is already merged. And because this bug impacts my application, I would appreciate a new release/prerelease of tui-prompts. Thanks in advance!

#48

kxxt added a commit to kxxt/tracexec that referenced this pull request May 11, 2024
The cursor position is not correct, which need to be fixed in upstream dependency: joshka/tui-prompts#46
@joshka
Copy link
Owner

joshka commented May 11, 2024

I'll release shortly. Thanks for the prs

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

Successfully merging this pull request may close these issues.

None yet

3 participants