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

select_next_item ignores count when no items were previously selected

Open litoj opened this issue 2 years ago • 0 comments

FAQ

  • [X] I have checked the FAQ and it didn't resolve my problem.

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-path'
call plug#end()
PlugInstall | quit

" Setup global configuration. More on configuration below.
lua << EOF
local cmp = require "cmp"
cmp.setup {
  mapping = {
    ['<C-3>'] = cmp.mapping.select_next_item({ count = 3 })
  },

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

Description

after pressing /<C-3> the first entry is selected

Steps to reproduce

edit a file and press /<C-3> in insert mode

Expected behavior

the third entry is selected

Actual behavior

the first entry is selected

Additional context

No response

litoj avatar Nov 23 '23 19:11 litoj