[PATCH] D42372: [clang-format] Ignore UnbreakableTailLength sometimes during breaking

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 07:34:24 PST 2018


djasper added a comment.

I think I understand now. I think I'd prefer pulling all of the "+ UnbreakableTailLength" calculations out of getRemainingLength so that you don't have to pass around the new parameter CanBreakAfter. Instead, only add it if necessary outside of the function.



================
Comment at: lib/Format/BreakableToken.cpp:503
+                                                   bool CanBreakAfter) const {
   return UnbreakableTailLength +
          getRangeLength(LineIndex, Offset, StringRef::npos, StartColumn);
----------------
Forgot to check CanBreakAfter here?


Repository:
  rC Clang

https://reviews.llvm.org/D42372





More information about the cfe-commits mailing list