Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

...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 this issue Jun 3, 2023 · 1 comment

Comments

@VisionaryAppDev
Copy link

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
Copy link
Author

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,
     ...
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant