-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Can't use // line comments in C #489
Comments
should use get and set instead require('Comment.ft').set('c', {'//%s', '//%s'}) And I don't think this make any sense? the second element is for block commenting, you can never use |
I got it working with this: vim.api.nvim_create_autocmd('Filetype', {
pattern = 'c',
callback = function()
vim.bo.commentstring = '//%s'
end,
group = comment_augroup
}) Does Comment.ft get ignored for filetypes which have a commentstring? |
Comment.nvim/lua/Comment/utils.lua Lines 173 to 185 in e30b7f2
|
ft.set works, thanks. I thought I could assign to ft.c because of the examples for javascript and yaml in README.md, where it says "Metatable magic". Are those examples wrong? If not, why does that syntax work for yaml and javascript, but not c? |
I never noticed that usage, it actually should work since it uses set too. Comment.nvim/lua/Comment/ft.lua Lines 310 to 314 in e30b7f2
But it's set only, you can't get the value with the same form. |
I want to use // for my C comments, but the plugin seems to be hardwired to use /* */ for C. This config has no effect:
The text was updated successfully, but these errors were encountered: