-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Completion menu redisplayed after confirming completion with C-y #1282
Comments
It seems that second menu is semantic completion (ie just like C-Space was pressed immediately after C-y) |
I don't understand the need to confirm the completion using |
Sometimes I really need to insert some alignment with
|
Ok, I reopened this and we'll wait and see what @Valloric thinks about this. |
Here is a situation where I need By the way, #1272 works perfect, and introduce little complexity in my opinion |
I have some luck in fixing it but this requres patching vim.
Maybe someone could point out better way for resolving this issue that could be accepted by vim upstream? |
That is correct. Personally I don't think that patching vim this way is the right thing to do. EDIT: There's something similar to the |
@radioneko is right, the second popup menu shows because first |
@LiangZhi1027 The fact that is only one line doesn't mean that is a simple and clean way to fix it. That line needs to be maintained by someone who is not you. In the meantime you could always use |
@LiangZhi1027: imagine you have following candidates: ['free', 'free_foo', 'free_bar']. You type |
@radioneko Thanks for this example. I didn't consider it. So my solution isn't right :( |
I have patches for (g)vim and youcompleteme, so if anyone wants try it: |
@radioneko @Liangzhi233 Actually I think I just solve this without patching vim. The problem is that it require to call the function! CtrlY()
if pumvisible()
call s:UpdateCursorMoved()
endif
return "\<C-y>"
endfunction
inoremap <expr> <C-y> CtrlY() |
I had a similar problem, where In
See blueyed@3d035e9 I hope it works for your case - I could not reproduce the issue. |
This is required to properly handle the pum after manually invoking the completion and using e.g. <C-w> to delete the word; this won't trigger CursorMovedI. Ref: ycm-core#1282 (comment)
Update: the method from my previous comment did not work properly. I have changed it to call |
This issue is still relevant. I tested it with disabled another plugins to eliminate another potential causes of displaying menu:
I also tried
and I must confirm using |
@przepompownia |
[READY] Rewrite completion system There is a number of issues with the current completion system: - UI is blocked until the completions are returned by the server, the request timed out, or a key is pressed by the user. This leads to a rough experience when completions take too much time: cursor disappearing and timeout errors (see #2192 and #2574). Users even [increase the timeout by manually editing the `completion_request.py` file](https://github.com/Valloric/YouCompleteMe/blob/master/python/ycm/client/completion_request.py#L30) to avoid these errors, which exacerbate the issue and, in some cases, make the plugin unusable (see #2574). - no fuzzy matching from omnifunc when forcing semantic completion. See #961; - no fuzzy matching when deleting characters. Vim filtering is used instead: ![completion-bug-deleting-characters](https://cloud.githubusercontent.com/assets/10026824/26276156/f298c6de-3d71-11e7-92da-d22186239c27.gif) Neovim and MacVim are not affected. - completion menu disappears after deleting a character and inserting one: ![completion-bug-reinserting-character](https://cloud.githubusercontent.com/assets/10026824/26276192/b3ed0f7a-3d72-11e7-8c64-523a0a59cbdc.gif) Neovim and MacVim are not affected. - ignore the start column returned by the server. See PR #2489. - subject to flickers. This one depends a lot on the version of Vim. Completion is almost flicker-free in Neovim and MacVim. Not too bad in console Vim (except in fast terminal like [alacritty](https://github.com/jwilm/alacritty)). Awful in gVim GTK2 (a bit better on GTK3) and gVim on Windows. This PR is an attempt at fixing all of these issues while reducing flickers as best as possible (due to how completion works in Vim, a flicker-free experience is impossible to achieve). Here's how: - poll for completions using a timer and call `completefunc` once the completions are ready. Use the start column returned by the server in `completefunc`; - immediately display the last completions on the `TextChangedI` event to prevent the popup menu disappearing while waiting for the completions. This reduces flickering; - use the `InsertCharPre` event to close the completion menu just before inserting a character. This way the `TextChangedI` event is triggered when the character is inserted (this event is not fired when the completion menu is visible). This replaces the `refresh` option set to `always` in `completefunc` and the `s:cursor_moved` hack; - remap the backspace key to close the completion menu when deleting a character and thus triggering the `TextChangedI` event; - send a request with `force_semantic` set to `True` when forcing semantic completion instead of calling the omnifunc. This fixes the issue where there is no fuzzy matching for custom omnifuncs. Here's a demo where I added a spin animation on the command line while loading the completions to show that it doesn't block the Vim UI: ![async-completion-for-real](https://cloud.githubusercontent.com/assets/10026824/26277295/0f16a718-3d86-11e7-90f3-8a56bbf53f9f.gif) Fixes #961. Fixes #1282. Fixes #1881. Fixes #2192. Fixes #2500. Fixes #2574. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2657) <!-- Reviewable:end -->
Steps to reproduce:
After this completion menu popping again showing matches for word that was just inserted (including this word itself, so menu always has at least one item). If completion is aborted with C-e, no additional menus shown.
The text was updated successfully, but these errors were encountered: