numToStr / Comment.nvim

:brain: :muscle: // Smart and powerful comment plugin for neovim. Supports treesitter, dot repeat, left-right/up-down motions, hooks, and more
MIT License
3.94k stars 157 forks source link

Commenting visual block does not seem to work #208

Closed fikovnik closed 2 years ago

fikovnik commented 2 years ago

When I select a few lines and do gcc, I get the following error:

E5108: Error executing lua ...va/.config/nvim/plugged/Comment.nvim/lua/Comment/api.lua:19: attempt to call field 'd
eprecate' (a nil value)
stack traceback:
        ...va/.config/nvim/plugged/Comment.nvim/lua/Comment/api.lua:19: in function 'D'
        ...va/.config/nvim/plugged/Comment.nvim/lua/Comment/api.lua:473: in function '__index'
        [string ":lua"]:1: in main chunk

I'm on the latest version (ab63cc90d9cc2bcc93d8a24c4fae2ea4ed0795f1) running nvim 0.7.2. I do not have any extra configuration over the single call to setup.

Any idea what could be wrong? Thank you, much appreciate the plugin!

numToStr commented 2 years ago

Everything working fine for me, and I doubt that the default keybindings would've caused this. FYI, the cause of error was introduced a week ago cd1c38163dd9a11247bcb333d72a36bae76c45f9 and the error is coming because somewhere old API is used, precisely require('Comment.api').locked.* API.

Are you, by any chance, using a nvim distro? like NvChad, AstroVim etc.

fikovnik commented 2 years ago

No, I have my own nvim config.

numToStr commented 2 years ago

Would you mind reproducing the issue with a minimal init.lua?

vanarok commented 2 years ago

2022-08-20T16:35:11,169859442+04:00

numToStr commented 2 years ago

@vanarok https://github.com/neovim/neovim/issues/19857

numToStr commented 2 years ago

I am going to close this for now as I can't reproduce this myself and other people doesn't seem to be facing this.