diff options
| -rw-r--r-- | clang/lib/Format/Format.cpp | 2 | ||||
| -rw-r--r-- | clang/unittests/Format/FormatTest.cpp | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index eac822c5b72..3660b4ac03e 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -488,7 +488,7 @@ private: State.Stack.back().Indent + Current.LongestObjCSelectorName; else State.Stack.back().ColonPos = - State.Column + Spaces + Current.LongestObjCSelectorName; + State.Column + Spaces + Current.FormatTok.TokenLength; } // FIXME: Do we need to do this for assignments nested in other diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp index fc95acca527..c2e845b9be1 100644 --- a/clang/unittests/Format/FormatTest.cpp +++ b/clang/unittests/Format/FormatTest.cpp @@ -2381,6 +2381,12 @@ TEST_F(FormatTest, FormatObjCMethodExpr) { " selector:@selector(willEnterFullscreen)\n" " name:kWillEnterFullscreenNotification\n" " object:nil];"); + verifyFormat("[image_rep drawInRect:drawRect\n" + " fromRect:NSZeroRect\n" + " operation:NSCompositeCopy\n" + " fraction:1.0\n" + " respectFlipped:NO\n" + " hints:nil];"); } TEST_F(FormatTest, ObjCAt) { |

