-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Fix: Prevent flicker when LSP server is slow #18439
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
Conversation
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 PR 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).
M src/insexpand.c
M src/insexpand.c
thanks |
Thx. It is better and worse at the same time :).
|
Screencast doesn't show, but there are noticeable delays between keypress and char insertion, which feels not great. |
I'll look into this. |
That patch is wrong. It causes overflow of It causes segfault on MS-Windows: #18450 Stack trace:
|
There are side effects indeed. Should be reverted. |
Ref: girishji/vimcomplete#101 (comment)
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 triggersout_flush()
.This causes the deleted text to briefly disappear before being redrawn when results arrive, producing a visible flicker.
There are two possible fixes:
This PR 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).