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

Wrong value of wcwidth for emoji #12523

Closed
nacknime-official opened this issue Jun 23, 2020 · 6 comments
Closed

Wrong value of wcwidth for emoji #12523

nacknime-official opened this issue Jun 23, 2020 · 6 comments
Labels
bug issues reporting wrong behavior unicode 💩 (multibyte) unicode characters
Milestone

Comments

@nacknime-official
Copy link

  • nvim --version:
NVIM v0.5.0-547-gdd4018947
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-5 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/travis/build/neovim/bot-ci/build/neovim/build/config -I/home/travis/build/neovim/bot-ci/build/neovim/src -I/home/travis/build/neovim/bot-ci/build/neovim/.deps/usr/include -I/usr/include -I/home/travis/build/neovim/bot-ci/build/neovim/build/src/nvim/auto -I/home/travis/build/neovim/bot-ci/build/neovim/build/include
Compiled by travis@travis-job-410d26af-e3fc-46f1-9ea4-44eef6b04ebd

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info
  • vim -u DEFAULTS (version: 8.2.814) behaves differently? particulary yes
  • OS: Archlinux
  • WM: Sway (wayland)
  • CPU: Intel Core i7-8550U
  • GPU: Intel UHD Graphics 620 (rev 07)
  • Driver: mesa 20.1.1-1
  • Terminal / version: kitty 0.18.0 created by Kovid Goyal
  • $TERM: xterm-256color

Steps to reproduce using nvim -u NORC

Actual behaviour

Expected behaviour

see in kovidgoyal/kitty#2786

@nacknime-official nacknime-official added the bug issues reporting wrong behavior label Jun 23, 2020
@teto
Copy link
Member

teto commented Jun 23, 2020

for what character ? we use libc's wcwidth if you want to check

@nacknime-official
Copy link
Author

for what character ? we use libc's wcwidth if you want to check

maybe for all emojis. probably, I've named this issue wrong way, I'm sorry, but please, check the issue that I left in the end of this issue text

@teto
Copy link
Member

teto commented Jun 24, 2020

basically terminal and nvim and fonts have to agree, that's one of the problem without good solutions at the time. You can try unsetting the 'emoji' option or read the ambiwidth option to see if that helpo. Otherwise https://github.com/thestinger/termite uses libc's wcwidth so it may work better for you.

@teto
Copy link
Member

teto commented Jul 20, 2020

not sure there is a good solution here, all components need to use the same source of truth.
btw may be related #7151 (comment)

@tomaskallup
Copy link

I think I stumbled on this too.

I have a TS file containing following text:

      /*
        Search for candidates has to be separated into 2 queries
        because $geoNear must be a top-level operator.
        Therefore, it cannot be used in $or query. 🤦‍♂️
      */

If I open the file, scroll the comment out of view and then scroll back to it, this happens:
image
Removing the emoji fixes the problem.
However the problem seems to be that my font is missing the "male" variant of the emoji, so it prints a longer version than the 2 characters it should.

@dundargoc dundargoc added the unicode 💩 (multibyte) unicode characters label Oct 13, 2021
@justinmk justinmk added this to the backlog milestone Oct 18, 2021
@zeertzjq
Copy link
Member

Either fixed by #19686 or duplicate of #7151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior unicode 💩 (multibyte) unicode characters
Projects
None yet
Development

No branches or pull requests

6 participants