mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 09:56:31 +00:00

Problem: completion: flicker when LSP server is slow
Solution: reinsert leader text before invoking user function
(Girish Palya)
Reference:
https://github.com/girishji/vimcomplete/issues/101#issuecomment-3343063245
In insert-mode completion, the leader text is temporarily removed while
searching for candidates. When the LSP server responds slowly, the
client may call `:sleep` to wait, which triggers `out_flush()`. This
causes the deleted text to disappear briefly before being redrawn,
resulting in visible flicker.
This commit reinserts the leader text before invoking the user function,
and removes it again afterward to eliminate flicker.
closes: vim/vim#18468
c51d1cc578
Co-authored-by: Girish Palya <girishji@gmail.com>