packer.nvim
packer.nvim copied to clipboard
Recent update (on command-lazyloading) screws up vim-floaterm
nvim --version: 0.8.1git --version: 2.38.1- Operating system/version: Linux, kernel 6.0.11-arch1-1
- Terminal name/version: kitty 0.26.5
Steps to reproduce
- Use packer to install vim-floaterm with lazyloading:
use {
'voldikss/vim-floaterm',
cmd = {
'FloatermNew',
'FloatermToggle'
},
}
- Enter nvim
- Type in commandline:
FloatermNew - Hit space
- Floaterm opens a new terminal with error right after we hit space
Actual behaviour
See above.
Expected behaviour
Floaterm should not open a new terminal before we hit <Enter>. The problem is command-lazyloading: if I do not lazy load Floaterm, or use key-lazyloading, the problem will not appear.
I can't reproduce this. Is it still an issue? What packer commit are you on?
I can't reproduce this. Is it still an issue? What
packercommit are you on?
Hi! Thank you for your reply, I also find that with minimal config i.e. single init.lua that only calls packer.startup and registers packer and vim-floaterm does not have this issue. I'm trying to figuring out the real reason. I'll close this if the issue is related to packer. Sorry for the inconvenience.
It turns out nvim-cmp is the cause of the problem (don't know why). Close this issue.
For anyone interested about the bug, the minimal config is:
vim.cmd('packadd packer.nvim')
require('packer').startup({
function(use)
use({ 'wbthomason/packer.nvim' })
use({
'voldikss/vim-floaterm',
cmd = { 'FloatermNew', 'FloatermToggle' },
})
use({
'hrsh7th/nvim-cmp',
config = function()
local cmp = require('cmp')
cmp.setup()
cmp.setup.cmdline(':', {
enabled = true,
sources = {
{ name = 'cmdline' },
}
})
end,
})
use({
'hrsh7th/cmp-cmdline',
requires = 'nvim-cmp',
})
end,
})
save it as init_test.lua and use nvim -u init_test.lua to start nvim.
Reopen this issue because I find starting from commit ed2d5c9c17f4df2eeaca4878145fecc9669e0138 the problem arises. Before this commit packer uses file as the complete option for nvim_create_user_command(); after this commit packer uses a custom function to get the completion list. While this brings a better completion experience, it also introduces the bug mentioned in the issue.
@wbthomason
A short video demonstrating the bug:
https://user-images.githubusercontent.com/76579810/207523205-bd5db373-0769-4d8a-a33c-4f5016822f58.mp4
Also see the issue under nvim-cmp: https://github.com/hrsh7th/nvim-cmp/issues/1348