hrsh7th / cmp-cmdline

nvim-cmp source for vim's cmdline
MIT License
567 stars 45 forks source link

cmdline causes nvim to freeze up if I try to type `:!` #5

Closed petertriho closed 3 years ago

petertriho commented 3 years ago

Describe the bug nvim freezes up if I try to type :! in the cmdline

Minimal config based on this

if has('vim_starting')
  set encoding=utf-8
endif
scriptencoding utf-8

if &compatible
  set nocompatible
endif

let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/plug.vim')
  execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end

execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'hrsh7th/nvim-cmp'
Plug 'hrsh7th/cmp-buffer'
Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'hrsh7th/vim-vsnip'
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/cmp-cmdline'
call plug#end()
PlugInstall | quit

" Setup global configuration. More on configuration below.
lua << EOF
local cmp = require "cmp"
cmp.setup {
  snippet = {
    expand = function(args)
      vim.fn["vsnip#anonymous"](args.body)
    end,
  },

  mapping = {
    ['<CR>'] = cmp.mapping.confirm({ select = true })
  },

  sources = {
    { name = "nvim_lsp" },
    { name = "buffer" },
  },
}

cmp.setup.cmdline(":", {
    sources = cmp.config.sources({
        { name = "path" },
    }, {
        { name = "cmdline" },
    }),
})
EOF

lua << EOF
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())

require'lspconfig'.cssls.setup {
  capabilities = capabilities,
}
EOF

To Reproduce

  1. Type :!

Expected behavior Should not freeze up

Additional context

Only happens in wsl2. Tested in MacOS and I don't have the issue

sQVe commented 3 years ago

This works fine for me v0.6.0-dev+501-gcb15055c29.

petertriho commented 3 years ago

Looks like it an issue with my WSL2 setup

Sh3Rm4n commented 3 years ago

I can confirm that this happens for my WSL2 setup, too.

hugoppp commented 3 years ago

This still happens to me on v0.6.0 release build, using WSL2

dstanberry commented 2 years ago

@hrsh7th It seems to have been re-introduced in e5aa12620b6cae9ba5ce27aed2c47a99b81f004f

Daz9 commented 2 years ago

This is happening for me as well on WSL2.

redbeardt commented 2 years ago

Another affected WSL2 user here. Here's my clip where I wait for the hanging to stop. Takes about 2 minutes.

https://user-images.githubusercontent.com/22147604/154457635-303ea56b-5288-4db2-8067-ae83b4b7d189.mov

izkluxcvy commented 2 years ago

Ignore !, or is there any solution?