How to prevent clang-format to add space after char comment?

I have comments in my code:

//asdf 

when I use clang-format on it, it adds a space immediately after // characters:

 // asdf 

How can I prevent this from clang style configuration?

thanks

+6
source share
1 answer

Combining the answers to these two questions should solve the problem:

So, the following line in your .clang-format file should do the trick (I have not tested it):

 CommentPragmas: '^[^ ]' 

This says that clang-format does not interfere with comments starting with something other than a space.

For completeness of clang format documentation here .

+5
source

All Articles