-
-
Notifications
You must be signed in to change notification settings - Fork 167
Closed
Description
Hey, really nice plugin, I love using it.
The other day I tried to use it on a JSON file. I forgot it wasn't possible to comment JSON, but after I did I received this error message:
E5108: Error executing lua Vim(lua):E5108: Error executing lua .../site/pack/packer/opt/Comment.nvim/lua/Comment/utils.lua:156: [Comment] Invalid commentstring - "". Run :h 'commentstring' for help.
stack traceback:
[C]: in function 'assert'
.../site/pack/packer/opt/Comment.nvim/lua/Comment/utils.lua:156: in function 'parse_cstr'
...site/pack/packer/opt/Comment.nvim/lua/Comment/optfunc.lua:62: in function 'opfunc'
...im/site/pack/packer/opt/Comment.nvim/lua/Comment/api.lua:279: in function 'current'
[string ":lua"]:1: in main chunk
[C]: at 0x55d7ba838e46
stack traceback:
[C]: at 0x55d7ba838e46
It's totally correct for the plugin to refuse to comment in a language that hasn't that feature.
But what I would suggest is avoiding to crash and break the user experience.
The plugin could show a yellow message under the statusline with something like
Comment.nvim: commenting unsupported
For example, in nvim-lspconfig, when a Language Server crashes, it's reported this way.
Thanks for your time and your awesome plugin
Metadata
Metadata
Assignees
Labels
No labels