]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.2.0905: MS-Windows: ghost cursor with ligatures v9.2.0905
authorFoxe Chen <chen.foxe@gmail.com>
Mon, 3 Aug 2026 20:13:17 +0000 (20:13 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 3 Aug 2026 20:13:17 +0000 (20:13 +0000)
Problem:  With ligatures enabled, a ghost cursor can be left on screen
          because the cursor is marked valid before the ligature
          cleanup, which redraws the cell with gui_screenchar() and
          invalidates the cursor again (ubaldot)
Solution: Set gui.cursor_is_valid only after the ligature redraw is
          done, so it isn't cleared afterwards (Foxe Chen).

fixes:  #20916
closes: #20924

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/gui.c
src/version.c

index 5d6eae1054374d1e201e42a87b127450d95c3390..e2b3b40218ae9d430e8350aaf40b3307b40a3ba1 100644 (file)
--- a/src/gui.c
+++ b/src/gui.c
@@ -1412,9 +1412,6 @@ gui_update_cursor(
            }
            break;
        }
-    // gui_redraw_block() may invalidate the cursor, make sure to validate
-    // it again.
-    gui.cursor_is_valid = true;
 
 # ifndef USE_GTK4
     if ((lig_left || lig_right) && shape->shape != SHAPE_BLOCK)
@@ -1430,6 +1427,9 @@ gui_update_cursor(
        gui.col = old;
     }
 # endif
+    // gui_redraw_block()/gui_screenchar() may invalidate the cursor, make sure
+    // to validate it again.
+    gui.cursor_is_valid = true;
 #endif
 
     old_hl_mask = gui.highlight_mask;
index abd19fb95acf68c560e12a6e471709aabcb963af..7bb915f93224d01f5c927f28f5f300663907214b 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    905,
 /**/
     904,
 /**/