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

always use line-wise C commentstring #85

Merged
merged 2 commits into from
Jul 8, 2024

Conversation

mortezadadgar
Copy link
Contributor

@mortezadadgar mortezadadgar commented Nov 20, 2023

separated this from the #84 as I think this require some discussions. this change has been made to follow default behavior of vim ftplugin which is always to use /* %s */ not matter it's block or line-wise commenting.
and besides that plugins like vim-commentray and mini.comment doesn't even support block commenting and therefore this come to surprising new users as their C commentstring has changed from this plugin

@mortezadadgar mortezadadgar changed the title use default C commentstring always use line-wise C commentstring Nov 20, 2023
@JoosepAlviste
Copy link
Owner

This is an interesting case and I can see the reasoning of keeping the defaults from Vim. I also saw that support for single-line comments was added in C99, so it hasn't always been a part of the language.

However, this seems like a pretty subjective change and could be easily configured by the user. Also, this change would technically be a breaking change, so I'm quite hesitant to accept this.

Could we somehow ask for more opinions about this, from people who write C?

@mortezadadgar
Copy link
Contributor Author

plugins like Comment.nvim already change the commentstring based on line or block wise mappings i don't see the rational of being in business of changing commentstring, after #86 get merged I don't think there's any reason to change commentstring where it's not needed, anything I am missing?

@zyriab
Copy link

zyriab commented Jul 7, 2024

I think it should be configurable by the user.
I personally prefer C++ style (//) but had a job interview on a codebase not using C99, therefore requiring /* */.
Some major OSS projects like Wine require that type of comments, for example.
If there must be a default, I think for C it should be /* */, especially if it's Vim's default.

@JoosepAlviste
Copy link
Owner

Thanks for the input @zyriab! Let's merge this, then. I suppose we can follow the Vim defaults without worrying about things too much. It's a bit of a breaking change though, so I'll add a comment to the breaking changes issue about it.

@JoosepAlviste JoosepAlviste merged commit f190513 into JoosepAlviste:main Jul 8, 2024
1 check passed
@JoosepAlviste JoosepAlviste mentioned this pull request Jul 8, 2024
@mortezadadgar mortezadadgar deleted the patch-2 branch July 8, 2024 13:25
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

Successfully merging this pull request may close these issues.

3 participants