-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mouseshape to be set correctly when using 'r' or 'gr' #12157
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12157 +/- ##
==========================================
- Coverage 81.95% 81.94% -0.01%
==========================================
Files 160 164 +4
Lines 193810 194091 +281
Branches 43840 43829 -11
==========================================
+ Hits 158834 159052 +218
- Misses 22138 22207 +69
+ Partials 12838 12832 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 34 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
78af162
to
620f5b8
Compare
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 vim#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.
620f5b8
to
bea9ff8
Compare
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.
Thanks for looking into this. Could you add a test for this? There are
some examples at the end of src/testdir/test_normal.vim. However, the
ugly "sleep 300m" should be removed, use WaitForAssert() instead.
…--
Every person is responsible for the choices he makes.
/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|
Sure. Let me take a look. |
Any updates on this? |
I remember the tests were a little tricky to actually write to make it a proper regression test, and then other things came up and I neglected to follow up on this. Let me take a look again. |
any updates here please ? |
Currently, when entering the "pretend" or single character replace modes using
r
orgr
(in GUI), the mouse cursor doesn't immediately update until you have re-focused the window or moved the mouse. This is because it's not callingupdate_mouseshape(-1)
immediately, so the cursor will only be updated when it's called by other functions likegui_mouse_focus
(which happens just if you move the mouse or re-focus the application).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 mousegr
call which triggers a mouse shape change but it probably would have failed under other circumstances.