Skip to content

Commit a1b654f

Browse files
ychinchrisbra
authored andcommitted
patch 9.1.0856: mouseshape might be wrong on r and gr
Problem: mouseshape might be wrong on r and gr Solution: call update_mousesape(-1) immediately (Yee Cheng Chin) Currently, when entering the "pretend" or single character replace modes using `r` or `gr`, the mouse cursor doesn't immediately update until you have re-focused the window or moved the mouse. This is because it's not calling `update_mouseshape(-1)` immediately, so the cursor will only be updated when it's called by other functions like `gui_mouse_focus`. To fix this, just make sure we call this `update_mouseshape(-1)`. It's what we do when entering Insert or Replace modes for example. I noticed this when trying to figure out why MacVim CI is failing in `Test_mouse_shape_after_cancelling_gr` (introduced in #12110), but I think that test is only passing in Vim GTK CI by accident, since this issue happens there too. I think the window captured focus after the mouse `gr` call which triggers a mouse shape change but it probably would have failed under other circumstances. fixes: #14660 closes: #12157 Signed-off-by: Yee Cheng Chin <ychin.git@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 2e48567 commit a1b654f

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/normal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ normal_cmd_get_more_chars(
417417
State = MODE_REPLACE; // pretend Replace mode
418418
#ifdef CURSOR_SHAPE
419419
ui_cursor_shape(); // show different cursor shape
420+
#endif
421+
#ifdef FEAT_MOUSESHAPE
422+
update_mouseshape(-1);
420423
#endif
421424
}
422425
if (lang && curbuf->b_p_iminsert == B_IMODE_LMAP)

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
856,
707709
/**/
708710
855,
709711
/**/

0 commit comments

Comments
 (0)