-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
return 2 for emoji width in the 0x2300-0x1f000 range if ambw=double #2074
Conversation
Yaruhiro wrote:
On current implementation, emoji characters in range 0x2300-0x1f000 is
not listed which return 2 from utf_char2cells(). I know this is
compatible issue.
#665
3848e00
6a08454
Now, I'm thinking that user who got the compatible issue should set
ambiwidth=single. So I suggest to return 2 for the emoji characters in
the range 0x2300-0x1f000, if ambiwidth=double.
If you don't like this, I can make patch to add new option or detect
locale string is CJK.
I get very confused about the 'emoji' option. The docs say:
When on all Unicode emoji characters are considered to be full width.
But then it only applies to the characters in emoji_width, not
emoji_all. Why doesn't it use emoji_all?
Then utf_ambiguous_width() returns true for all emoji characters, but
when 'amibwidth' is "double" this isn't taken into account.
So what should be the proper behavior? Are there any characters in
emoji_all that are always single width? The utf_ambiguous_width() needs
to be ajusted.
…--
A fool learns from his mistakes, a wise man from someone else's.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Please remember this thread on mailing list.
Some of terminal still not be fixed to show emoji as square box. On such terminal, I thought for the way to fix this issue. And I guess the user who expect narrow width for ↖ should set ambiwidth=single. |
However, I can not make sure that there are no side effects from my suggestion. So, if you do not like this change, I can prepare another option. |
Yasuhiro wrote:
> I get very confused about the 'emoji' option. The docs say:
>
> When on all Unicode emoji characters are considered to be full width.
>
> But then it only applies to the characters in emoji_width, not
> emoji_all. Why doesn't it use emoji_all?
>
> Then utf_ambiguous_width() returns true for all emoji characters, but
> when 'amibwidth' is "double" this isn't taken into account.
Please remember this thread on mailing list.
https://groups.google.com/forum/#!searchin/vim_dev/Arrow$20characters$20shouldn$27t$20be$20wide%7Csort:relevance/vim_dev/fu0ZZIx5gjk/2-MOLugwGgAJ
That discussion was open ended. And the help for the 'emoji' option is
wrong, it only applies to the characters in "emoji_width".
And the comment for it says "Emoji characters that don't have ambiguous
or double width". Even though they are double width in the emoji
table...
6a08454
> So what should be the proper behavior? Are there any characters in emoji_all that are always single width? The utf_ambiguous_width() needs to be ajusted.
Some of terminal still not be fixed to show emoji as square box. On
such terminal, `↖` is drawn as narrow width. There are two types of
terminal. One of them draw ↖ as narrow, Other one draw ↖ as wide. So
we should provide way to switch them.
I thought for the way to fix this issue. And I guess the user who
expect narrow width for ↖ should set ambiwidth=single.
No, 'ambiwidth' has no relattion to emoji characters. It's for another
group of characters.
Is it right to say that all emoji characters should be double width, but
in some fonts a subset is single width?
…--
To be rich is not the end, but only a change of worries.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Sorry, my idea is bad. you are right. So it can't define with single option emoji. How about following ideas to correct this issue. new function to define widths
load cell-width list file
Should be list as same as above func. override wcwidth by dll/soint
my_wcwidth(int c) {
return /* my custom width */
} or int
my_wcwidth(const char fontname, int c) {
return /* my custom width */
} |
Is this PR going to be worked on or shall we close it? |
I want still working on this. |
There is no progress on this, and also I don't see any issues being reported for emoji's. Therefore closing this. If you do have a known problem, please explain. |
Ref: 08aac3c |
On current implementation, emoji characters in range 0x2300-0x1f000 is not listed which return 2 from utf_char2cells(). I know this is compatible issue.
#665
3848e00
6a08454
Now, I'm thinking that user who got the compatible issue should set ambiwidth=single. So I suggest to return 2 for the emoji characters in the range 0x2300-0x1f000, if ambiwidth=double.
If you don't like this, I can make patch to add new option or detect locale string is CJK.