completion-nvim icon indicating copy to clipboard operation
completion-nvim copied to clipboard

Completion window causes vim.schedule error

Open Robaire opened this issue 3 years ago • 0 comments

Completion frequently causes the error: Error executing vim.schedule lua callback: /opt/neovim/runtime/lua/vim/lsp/util.lua:1025: Failed to switch to window 10--)

In my case this seems to happen only when loading completions for OpenCV and when typing quickly. My theory is that I am typing faster than the completions are loading (slowly since OpenCV is large), and effectively the window no longer exists when necessary.

Minimal init.lua

require('packer').startup(function()
  use 'wbthomason/packer.nvim'
  
  use 'neovim/nvim-lspconfig'
  use 'nvim-lua/completion-nvim'
end)

require('lspconfig').clangd.setup{}

vim.api.nvim_set_keymap('i', '<Tab>', 'pumvisible() ? "<C-n>" : "<Tab>"', {noremap = true, expr = true})
vim.api.nvim_set_keymap('i', '<S-Tab>', 'pumvisible() ? "<C-n>" : "<S-Tab>"', {noremap = true, expr = true})
vim.api.nvim_command('au BufEnter * lua require\'completion\'.on_attach()')
vim.api.nvim_command('set completeopt=menuone,noinsert,noselect')

Robaire avatar May 13 '21 16:05 Robaire