[vim/vim] [gVim] Font ligatures don't display correctly when directly placed under cursor (Issue #12901)

244 views
Skip to first unread message

thunderbird-1990

unread,
Aug 23, 2023, 3:24:13 PM8/23/23
to vim/vim, Subscribed

Steps to reproduce

I disabled cursor blinking for the purpose of screenshots (set guicursor+=a:blinkon0), but the behaviours are the same with or without this line.

  1. Enable ligatures (e.g., set guiligatures=!\"#$%&()*+-./:<=>?@[]^_{\|~)
  2. Use a font that supports ligatures (e.g., set guifont=JetBrainsMono\ 12)
  3. Place the cursor over a character that is a part of a ligature
  4. The underlying (non-ligatured) character is shown, which is a bigger problem in insert mode because both the non-ligatured character and the ligature are shown

ligature_01
ligature_02
ligature_03
ligature_04

Expected behaviour

I expected only the ligature to be shown.

Version of Vim

9.0.1736

Environment

OS: Arch Linux
Typeface/font: JetBrains Mono
gVim: 9.0.1736
Colour theme: PaperColor

Logs and stack traces

No response


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12901@github.com>

thunderbird-1990

unread,
Dec 5, 2023, 9:11:30 AM12/5/23
to vim/vim, Subscribed

Can anyone replicate this? Or fail to replicate? That would also be helpful.

Just want to add that my desktop environment is KDE. This bug continues to exist on my machine with gVim 9.0.2143.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12901/1840868302@github.com>

Erik S. V. Jansson

unread,
Feb 23, 2024, 4:20:07 PM2/23/24
to vim/vim, Subscribed

I think I'm seeing something similar.

OS: Windows 10
Typeface/font: Iosevka
gVim: 9.1.0
Color theme: gruvbox

The ligature starts in a broken state, but eventually fixes itself (mostly) after a while. But whenever you bring the cursor on-top of a ligature again, it looks broken again. By pressing Ctrl-L (which IIRC redraws the screen) the problem is completely "fixed" until you start moving the cursor again or write more ligatures.

I have not specified any set guiligatures in my .vimrc, but AFAIK from a related issue reported here, that does not seem to do anything since ligatures will always be used, as long as you use a font with ligatures (see #13435 for more info). The only special thing I have in my .vimrc re: to ligatures is set rop=type:directx which was needed to get ligatures to show up at all in gvim.

Here's a short GIF to show what's happening here (every time the ligatures look correct, it's due to me manually pressing Ctrl-L):

ligatures.gif (view on web)


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12901/1962003049@github.com>

Erik S. V. Jansson

unread,
Feb 23, 2024, 8:24:18 PM2/23/24
to vim/vim, Subscribed

Hmm, I think I see the problem. gui_undraw_cursor in gui.c is only expanding the cursor in GTK. This is also why guiligatures doesn't actually do anything in Windows gvim. When you hover over the ligature it only redraws the cursor at the position and one character before it. In reality, it needs to redraw the whole ligature (i.e. search for those guiligature characters before and after). So fix looks quite easy, just need to make gui_adjust_undraw_cursor_for_ligatures work for Win32. But yeah, I think my problem is different from the one detailed in the original ticket.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12901/1962200638@github.com>

Michael Scheper

unread,
Aug 9, 2024, 12:26:53 PM8/9/24
to vim/vim, Subscribed

I'm seeing this issue in 8.2.2121 under GTK (refer to the xref above), so it doesn't seem to be just a Windows thing.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/12901/2278316045@github.com>

Reply all
Reply to author
Forward
0 new messages