From 185de2499b9ff5cf0fa9df3010565373a4089cb8 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Thu, 11 Jul 2013 13:48:16 +0000 Subject: Fix indentation problem for comments in call chains Before: SomeObject // Calling someFunction on SomeObject .someFunction(); After: SomeObject // Calling someFunction on SomeObject .someFunction(); llvm-svn: 186085 --- clang/lib/Format/Format.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Format/Format.cpp') diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index ad390c23dcd..0dd47fe4a99 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -589,7 +589,8 @@ private: State.Column, Line.InPPDirective); } - State.Stack.back().LastSpace = State.Column; + if (!Current.isTrailingComment()) + State.Stack.back().LastSpace = State.Column; if (Current.isOneOf(tok::arrow, tok::period) && Current.Type != TT_DesignatedInitializerPeriod) State.Stack.back().LastSpace += Current.CodePointCount; -- cgit v1.2.3