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

Custom Entries Error after 'get-selected' api

Open smsjr opened this issue 1 year ago • 8 comments

After last commit (e1757ae), I'm getting the following error when trying to select suggestions (through TAB, <C-n> or arrows):

E5108: Error executing lua: .../nvim/lazy/nvim-cmp/lua/cmp/view/custom_entries_view.lua:328: attempt to perform arithmetic on local 'cursor' (a nil value)
stack traceback:
	.../nvim/lazy/nvim-cmp/lua/cmp/view/custom_entries_view.lua:328: in function 'select_next_item'
	...e/smsjr/.local/share/nvim/lazy/nvim-cmp/lua/cmp/view.lua:224: in function 'select_next_item'
	...e/smsjr/.local/share/nvim/lazy/nvim-cmp/lua/cmp/init.lua:146: in function 'select_next_item'
	/home/smsjr/.config/nvim/lua/plugins/config/cmp.lua:195: in function 'on_keymap'
	...e/smsjr/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:145: in function 'callback'
	....local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/keymap.lua:133: in function <....local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/keymap.lua:127>

I've already tried updating custom entries configs (following the Wiki), but also unsuccessful.

smsjr avatar Jul 15 '24 18:07 smsjr

Just got this as well.

gazsp avatar Jul 15 '24 19:07 gazsp

Culprit is here --> https://github.com/hrsh7th/nvim-cmp/pull/1986

sjclayton avatar Jul 15 '24 19:07 sjclayton

pushed a fix #1989

thesantatitan avatar Jul 15 '24 19:07 thesantatitan

I have that too.

miguelsrmv avatar Jul 15 '24 22:07 miguelsrmv

Please test this.

https://github.com/hrsh7th/nvim-cmp/pull/1993

Shougo avatar Jul 16 '24 01:07 Shougo

Meanwhile reverting e1757ae locally worked for me

barreiroleo avatar Jul 16 '24 01:07 barreiroleo

#1993 solved this issue for me.

sjclayton avatar Jul 16 '24 05:07 sjclayton

It should be closed.

Shougo avatar Jul 16 '24 06:07 Shougo