Fix multiple cursor invalidation issues #17181
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There were multiple bugs:
This means we need to not just invalidate the old cursor rect
but also the new one, or else movements may not be visible.
the cursor is invisible, but inside the renderer viewport.
position even if the cursor is invisible.
viewport. It's more like a cursor that's not turned on.
To resolve the first issue we simply need to call
InvalidateCursor
again. To do so, it was abstracted into
_invalidateCurrentCursor()
.The next 2 issues are resolved by un-
optional
-izingCursorOptions
.After all, even an invisible or an out-of-bounds cursor still has a
coordinate and it may still be scrolled into view.
Instead, it has the new
inViewport
property as a replacement.This allows for instance the IME composition code in the renderer
to use the cursor coordinate while the cursor is invisible.
The last issue is fixed by simply changing the
.isOn
logic.Closes #17150
Validation Steps Performed
printf "\e[2 q"; sleep 2; printf "\e[A"; sleep 2; printf "\e[B"
Cursor moves up after 2s and then down again after 2s. ✅
"\e[?25l"
) and use a CJK IME.Words can still be written and deleted correctly. ✅
"\e[?25h"
) works ✅