Closed marekdedic closed 2 years ago
With this config, upon pressing enter, the cursor jumps to where the end of the suggestion should be, however, the suggestion itself only appears after a while, say a second.
The key-mapping for coc#pum#confirm()
should only confirm completion, I don't understand what do you mean by suggestion itself only appears after a while
, it should not be trigger without character type by default.
Ok, I'll try to describe the process in more detail. I have the completion menu open, I select an item.
Seem your vim or the node blocked for some reason, checkout: https://github.com/neoclide/coc.nvim/wiki/F.A.Q#how-could-i-profile-vim https://github.com/neoclide/coc.nvim/wiki/F.A.Q#how-to-get-log-of-cocnvim
I have tried profiling vim and there is no script that would take long enough to be responsible for the delay. I tried looking into the log, nothing really interesting there - it tells me how long it took to find the completion suggestions - that is not my problem, my issue is when I select one of them...
Maybe you need nowait
, checkout your key-mapping by :imap <CR>
Adding nowait = true
doesn't chage the behaviour :(
You can check the trace log: https://github.com/neoclide/coc.nvim/wiki/F.A.Q#how-to-get-log-of-cocnvim
And the imap only shows the mapping I defined for CoC
I see a weird time jump between lines 115 and 116, is that it? coc-log.log
Hmm, I solved the issue incidentally by changing the mapping from
vim.api.nvim_set_keymap('i', '<CR>', 'coc#pum#visible() ? coc#pum#confirm() : <CR><c-r>=coc#on_enter()<CR>', {silent = true, expr = true})
to
vim.api.nvim_set_keymap('i', '<CR>', 'coc#pum#visible() ? coc#pum#confirm() : "<CR><c-r>=coc#on_enter()<CR>"', {silent = true, expr = true})
I don't know why that helped, but it did :shrug:
Result from CocInfo
Describe the bug
Hi, I have set the mapping as advised in the README:
With this config, upon pressing enter, the cursor jumps to where the end of the suggestion should be, however, the suggestion itself only appears after a while, say a second.
Reproduce the bug
mini.lua
with:Start (neo)vim with command:
vim -u mini.lua
Operate vim and try to confirm a suggestion.