Reputation: 23
EDIT: Open to solutions without clang-format
I want to get the following in one line using clang-format:
cout << "1"
<< " " << i << endl;
I have a large codebase I'm dealing with, let me know how it can be done!
I have tried all the "Penalty*" params in clang-format, they don't seem to help with us. My column limit is also very large.
Let me know if this is possible.
Upvotes: 1
Views: 153
Reputation: 1914
Unfortunately, clang-format
treats the <<
operator as special. What you see is apparently another special case, where two raw strings in a row always get separated onto separate lines. I can't find any way to disable this behavior. I've verified it on both clang-format
6.0.0 and 10.0.0 (using the configurator), so it has been there awhile.
I think it's a bug in clang-format
.
Upvotes: 1