问题
clang-format is breaking up my lines at 80 columns. Is there a way to make stop breaking lines? The documentation at
http://clang.llvm.org/docs/ClangFormatStyleOptions.html
doesn't seem to address this.
回答1:
The config option responsible for it is called ColumnLimit.
ColumnLimit: 99
回答2:
Find ColumnLimit (under "Configurable Format Style Options" heading) on that page and you'll find the following statement:
ColumnLimit (unsigned)
The column limit.
A column limit of 0 means that there is no column limit. In this case, clang-format will respect the input’s line breaking decisions within statements unless they contradict other rules.
Source: Clang-Format v6 Docs on 2019-01-04. Italics added for emphasis.
So, just like the docs say, set...
ColumnLimit: 0
... and you should be set.
来源:https://stackoverflow.com/questions/47683910/can-you-set-clang-formats-line-length