]> granicus.if.org Git - clang/commit
clang-format: Several improvements around formatting braced lists.
authorDaniel Jasper <djasper@google.com>
Fri, 8 May 2015 13:51:14 +0000 (13:51 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 8 May 2015 13:51:14 +0000 (13:51 +0000)
commit04822968f375ac612ec771d291c034b158ba0e23
tree4464d6ecb673e671b966813edabf24c2cc79bf4f
parent093c1675175c2c30a73e4779808d7c450d4b0161
clang-format: Several improvements around formatting braced lists.

In particular:
* If the difference between the longest and shortest element, we copped
  out of column format completely. Now, we instead allow to arrange
  these in a single column, essentially enforcing a one-per-line format.
* Allow column layout even if there are braced lists. Especially, if
  there are many short lists, this can be beneficial. The bad case,
  where there is a long nested init list is usually caught as we now
  limit the length difference of the longest and shortest element.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236851 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/FormatToken.cpp
unittests/Format/FormatTest.cpp