hrsh7th / cmp-cmdline

nvim-cmp source for vim's cmdline
MIT License
493 stars 42 forks source link

...e/pc/.local/share/nvim/lazy/nvim-cmp/lua/cmp/view.lua:102: attempt to call local 'fn' (a table value) #97

Open VisionaryAppDev opened 1 year ago

VisionaryAppDev commented 1 year ago

This plugin is working pretty fine for quite a long time. After stop using Nvim for quite some times and coming back, I have updated everything, including nvim and other plugin and then thing start to break.

When ever I try to use : or / or ?, then press any character, an error will be thrown. If i disabled this plugins, it will work as normal without any completion and error.

some setup for cmp cmdline:

-- completion when press ':' in normal mode
cmp.setup.cmdline(":", {
  mapping = cmdline_mapping,
  sources = {
    { name = "cmdline" },
    { name = "path" },
  },
})

-- Complete in command line for forward search
cmp.setup.cmdline("/", {
  mapping = cmdline_mapping,
  sources = {
    { name = "buffer" },
  },
})

-- Complete in command line for reverse search
cmp.setup.cmdline("?", {
  mapping = cmdline_mapping,
  sources = {
    { name = "buffer" },
  },
})

Here is some nvim detail:

:version
NVIM v0.10.0-dev-435+gc45a111e35
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wvla -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -fno-commo
n -Wno-unused-result -Wimplicit-fallthrough -fdiagnostics-color=always -fstack-protector-strong -DUNIT_TESTING -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -I/usr/include/luajit-2.1 -I/usr/include -I/home/norin/.cache/yay/neovim-git/src/b
uild/src/nvim/auto -I/home/norin/.cache/yay/neovim-git/src/build/include -I/home/norin/.cache/yay/neovim-git/src/build/cmake.config -I/home/norin/.cache/yay/neovim-git/src/neovim/src

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"
VisionaryAppDev commented 1 year ago

I think I have found some trace why it isn't working. The thing is, when I use cmp.config.compare.recently_used, the error will always throw (when it's on the top). But, by comment this code out, it will work without any issue.

  sorting = {
    comparators = {
      cmp.config.compare.recently_used,
     ...
  }