custom_entries_view
throws an error when the window is too smallΒ #1759
Closed
Description
FAQ
- I have checked the FAQ and it didn't resolve my problem.
Announcement
- I have checked Breaking change announcement.
Minimal reproducible full config
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'
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 = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "buffer" },
}),
}
EOF
lua << EOF
local capabilities = require('cmp_nvim_lsp').default_capabilities()
require'lspconfig'.cssls.setup {
capabilities = capabilities,
}
EOF
Description
...d/vim-plug/nvim-cmp/lua/cmp/view/custom_entries_view.lua:210: Expected Lua number
This error keeps occurring every single time when cmp tries to open the completion menu to complete the word.
Steps to reproduce
- Use the configuration.
- Make the terminal window tiny, as shown below:
- The error will keep occurring when there is more than 1 completion item.
Expected behavior
No error occurs and I get a tiny menu that has 1 or 2 words for the auto-completion. It used to work like that until something changed.
Actual behavior
...d/vim-plug/nvim-cmp/lua/cmp/view/custom_entries_view.lua:210: Expected Lua number
This error keeps occurring and it's nearly impossible to type anything.
Additional context
While the terminal window being that tiny may seem unreasonable, this actually happens a lot when using Firenvim on small text areas such as search bars and text boxes for chat apps.