fix: skip useless redraws when not running in Neovide #1903
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.
This is a follow-up to #1582. As far as I understand correctly,
nvim__redraw
is necessary to flush the changes to the neovim UI grid, which does not result in an immediate update if rendering is temporarily suspended by Neovide, but in all other types of UI this does result in an immediate redraw, such as when selecting different completion items with CTRL-N/CTRL-P. Compare:without my PR:
before.mp4
with this PR:
after.mp4
I was able to notice this because my statusline shows when I am in the popup completion mode (i.e. when
mode(1)
returnsic
,ix
or similar), but also, notice that the cursor quickly jumps around in the inserted line. Also, I am pretty sure that the functionutils.defer_neovide_redraw
is supposed to go inutils.lua
, nottext_edits.lua
.