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

Add support for unicode width aligned #2033

Closed
mrbeardad opened this issue Nov 25, 2020 · 1 comment
Closed

Add support for unicode width aligned #2033

mrbeardad opened this issue Nov 25, 2020 · 1 comment

Comments

@mrbeardad
Copy link

mrbeardad commented Nov 25, 2020

  • version: 7.1.2
  • problem: fmt::format does not take into acount width of characters.

code

    std::cout << fmt::format("{:-<10}{}", "你好", "世界") << std::endl;
    std::cout << fmt::format("{:-<10}{}", "hello", "world") << std::endl;

expected

你好------世界
hello-----world

Actual results

你好--------世界
hello-----world

and is 2 columns character. The source code of neovim may help you to implement this function.

vitaut added a commit that referenced this issue Feb 13, 2021
vitaut added a commit that referenced this issue Feb 13, 2021
@vitaut
Copy link
Contributor

vitaut commented Feb 13, 2021

Improved width computation in 7e72673. It should now give the expected result. Thanks for reporting.

@vitaut vitaut closed this as completed Feb 13, 2021
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

No branches or pull requests

2 participants