Commit: patch 9.2.0905: MS-Windows: ghost cursor with ligatures

Christian Brabandt <[email protected]> Mon, 3 Aug 2026 22:30:04 +0200
Newsgroups gmane.editors.vim.devel
Message-ID <[email protected]>
patch 9.2.0905: MS-Windows: ghost cursor with ligatures

Commit: https://github.com/vim/vim/commit/b362f0e2f953aa0080a6f69b1a72da8846e10032
Author: Foxe Chen <[email protected]>
Date:   Mon Aug 3 20:13:17 2026 +0000

    patch 9.2.0905: MS-Windows: ghost cursor with ligatures
    
    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 <[email protected]>
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/gui.c b/src/gui.c
index 5d6eae105..e2b3b4021 100644
--- 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;
diff --git a/src/version.c b/src/version.c
index abd19fb95..7bb915f93 100644
--- a/src/version.c
+++ b/src/version.c
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    905,
 /**/
     904,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1wqzIS-00BPo7-SQ%40256bit.org.