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

Use unicode9 character widths #1

Closed
wants to merge 31 commits into from

Conversation

joshuarubin
Copy link

Update runewidth to use unicode9 character width tables. This is the default in vim and neovim now, so should be safe to use in any terminal.

The Condition is no longer calculated using IsEastAsian() as terminals do not use locale to determine how wide to draw ambiguous with characters. Rather, they simply default to 1, and may offer an option to set to 2 (which is discouraged).

Once this repo is updated, when fzf is rebuilt, it will then use unicode9 widths as well.

All tests still pass. The API is very close to the way it was, but not identical. Still, fzf compiles using this version without issue.

A good example is to use fzf ctrl-r when there are emoji in the history. This should fix all rendering issues.

mattn and others added 30 commits January 13, 2015 14:14
Current web-specific code implementation is not complete, and assumes
non-east-asian. This is still an improvement because at least it
compiles. But someone who has access to and is familiar with east-asian
systems can complete the functionality.
Restore ability to compile to JavaScript.
Wrap関数を利用した際に、末尾の文字が消えてしまう問題を修正。
Wrap関数を利用した際に、末尾の文字が消えてしまう問題を修正。

(gofmted)
Before this change truncating "asdf" to a length of 4 with tail "…" will result
in "asd…". After this change, it will return "asdf".
don't truncate when input already fits
@junegunn
Copy link
Owner

junegunn commented Nov 29, 2016

Hi, please send the pull request directly to the upstream (https://github.com/mattn/go-runewidth). The purpose of this fork is only to make fzf unaffected by the changes made in the upstream. (There are of course better ways to manage dependencies in Go project, but anyway that's how I did it.) Once it's merged, just let me know, I'll update the fork.

@junegunn junegunn closed this Nov 29, 2016
@joshuarubin
Copy link
Author

This change has been merged upstream. Please update here.

junegunn added a commit to junegunn/fzf that referenced this pull request Feb 2, 2017
@junegunn
Copy link
Owner

junegunn commented Feb 2, 2017

Done. Thanks!

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.

6 participants