Can you set clang-format's line length?

偶尔善良 提交于 2019-12-10 01:48:14

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!