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 width #14

Merged
Merged

Conversation

mattn
Copy link
Contributor

@mattn mattn commented Apr 4, 2019

Description

Current implementation use utf8.RuneCountInString to calculate width of strings. But this is not right. In multi-byte strings, there are many characters which take 2 cells.

image

Fixes # (issue)

Use github.com/mattn/go-runewidth to calculate correct widths.

image

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • TestMultiByteString to make sure fixes with multi-byte strings

Test Configuration:

  • Not requires or instructions for this test

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@muhammadmuzzammil1998
Copy link
Owner

Nice! :)
DIdn't think about it. Thanks!

Is it still a work in progress or is it done?

@mattn
Copy link
Contributor Author

mattn commented Apr 5, 2019

done. I think.

@muhammadmuzzammil1998 muhammadmuzzammil1998 changed the base branch from master to version-3 April 5, 2019 12:11
@muhammadmuzzammil1998 muhammadmuzzammil1998 merged commit 4864025 into muhammadmuzzammil1998:version-3 Apr 5, 2019
@muhammadmuzzammil1998 muhammadmuzzammil1998 mentioned this pull request Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution enhancement New feature or request version 2.1 Things for version 2.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants