]> git.ipfire.org Git - thirdparty/vim.git/commit
patch 9.1.1812: completion: flicker with slow LSPs v9.1.1812
authorGirish Palya <girishji@gmail.com>
Mon, 29 Sep 2025 20:56:06 +0000 (20:56 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 29 Sep 2025 20:56:06 +0000 (20:56 +0000)
commit71b97f29054135151d618433a11ce611ba25844d
tree2a498e99320580cb1e5d4315648a461a4855bb56
parent8f214168bdf2948eb356a048596e70dd1114ee74
patch 9.1.1812: completion: flicker with slow LSPs

Problem:  completion: flicker with slow LSPs
Solution: Disable flushing the changed text (Girish Palya).

In insert-mode completion, the leader text is temporarily deleted while
searching for completion candidates. If the LSP server responds slowly,
the client may call `:sleep` to wait, which triggers `out_flush()`. This
causes the deleted text to briefly disappear before being redrawn when
results arrive, producing a visible flicker.

There are two possible fixes:

1. Suppress flushing while a user function (e.g. LSP client) is waiting.
2. Reinsert the deleted text before invoking the user function.

This Commit implements (1), which is the simpler solution, though somewhat
heavy-handed. If you think this may introduce unwanted side effects, I
can rework it to use (2).

closes: #18439

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/globals.h
src/insexpand.c
src/term.c
src/testdir/test_ins_complete.vim
src/version.c