equalsraf / neovim-qt

Neovim client library and GUI, in Qt5.
https://github.com/equalsraf/neovim-qt/wiki
ISC License
1.85k stars 171 forks source link

Emoji (Wide Character) cursor rendering incorrect #735

Open jgehrig opened 4 years ago

jgehrig commented 4 years ago

The cursor rendering logic isn't correct for some wide characters:

image

Repro Steps:

  1. Using Windows 10 + neovim-qt master
  2. nvim-qt -- -u NONE
  3. :GuiFont reports Consolas:h11
  4. Paste several emoji 😀 😃 😄 😁 😆 😅 😂 into the buffer
  5. Place the cursor over an emoji. Notice the character and an unknown character symbol render.

This is likely an issue in the guicursor logic. Discovered in #733.

jgehrig commented 4 years ago

Patch for this issue: emoji_cursor_render.diff.txt

The refactor in Pull #727 resolves this issue for :GuiRenderLigatures 0.

image

For :GuiRenderLigatures 1, this issue is still present. Likely an issue with ligature detection + wide characters.

jgehrig commented 3 years ago

There is a rendering position difference between :GuiRenderLigatures 1 and :GuiRenderLigatures 0

Repro Steps:

  1. :GuiFont! Fira\ Code:h50
  2. :set guifongwide=Noto\ Color\ Emoji:h18
  3. :GuiRenderLigatures 0
  4. :GuiRenderLigatures 1

Example: Ligatures Emoji Position