Skip to content

fix: skip useless redraws when not running in Neovide #1903

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

Merged
merged 2 commits into from
Jun 13, 2025
Merged

Conversation

dmitmel
Copy link
Contributor

@dmitmel dmitmel commented Jun 12, 2025

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) returns ic, ix or similar), but also, notice that the cursor quickly jumps around in the inserted line. Also, I am pretty sure that the function utils.defer_neovide_redraw is supposed to go in utils.lua, not text_edits.lua.

@Saghen Saghen merged commit feb34a9 into Saghen:main Jun 13, 2025
4 checks passed
@Saghen
Copy link
Owner

Saghen commented Jun 13, 2025

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants