[PATCH] D47393: [clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style for Objective-C π
    Ben Hamilton via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Jun 14 10:34:33 PDT 2018
    
    
  
This revision was automatically updated to reflect the committed changes.
Closed by commit rL334739: [clang-format] Disable AlwaysBreakBeforeMultilineStrings in Google style for⦠(authored by benhamilton, committed by ).
Herald added a subscriber: llvm-commits.
Changed prior to commit:
  https://reviews.llvm.org/D47393?vs=149338&id=151379#toc
Repository:
  rL LLVM
https://reviews.llvm.org/D47393
Files:
  cfe/trunk/lib/Format/Format.cpp
  cfe/trunk/unittests/Format/FormatTestObjC.cpp
Index: cfe/trunk/unittests/Format/FormatTestObjC.cpp
===================================================================
--- cfe/trunk/unittests/Format/FormatTestObjC.cpp
+++ cfe/trunk/unittests/Format/FormatTestObjC.cpp
@@ -1218,6 +1218,17 @@
                "}");
 }
 
+TEST_F(FormatTestObjC, AlwaysBreakBeforeMultilineStrings) {
+  Style = getGoogleStyle(FormatStyle::LK_ObjC);
+  Style.ColumnLimit = 40;
+  verifyFormat("aaaa = @\"bbbb\"\n"
+               "       @\"cccc\";");
+  verifyFormat("aaaa(@\"bbbb\"\n"
+               "     @\"cccc\");");
+  verifyFormat("aaaa(qqq, @\"bbbb\"\n"
+               "          @\"cccc\");");
+}
+
 } // end namespace
 } // end namespace format
 } // end namespace clang
Index: cfe/trunk/lib/Format/Format.cpp
===================================================================
--- cfe/trunk/lib/Format/Format.cpp
+++ cfe/trunk/lib/Format/Format.cpp
@@ -823,6 +823,7 @@
     // has been implemented.
     GoogleStyle.BreakStringLiterals = false;
   } else if (Language == FormatStyle::LK_ObjC) {
+    GoogleStyle.AlwaysBreakBeforeMultilineStrings = false;
     GoogleStyle.ColumnLimit = 100;
   }
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47393.151379.patch
Type: text/x-patch
Size: 1143 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180614/b127adaf/attachment.bin>
    
    
More information about the llvm-commits
mailing list