diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-07 07:13:20 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-07 07:13:20 +0000 |
commit | 46a46a20a3ec397192550915964cb227e87b79b2 (patch) | |
tree | 21b08fc17ae39cab0f960d529d3b1a5cb3467580 /lib/Format/Format.cpp | |
parent | 0028ee3dd32c5e3b089c0ef176b97ebcdd2c4cf6 (diff) |
Put a higher penalty on breaking before "." or "->".
This fixes llvm.org/PR14823.
Before:
local_state->SetString(prefs::kApplicationLocale, parent_local_state
->GetString(prefs::kApplicationLocale));
After:
local_state->SetString(
prefs::kApplicationLocale,
parent_local_state->GetString(prefs::kApplicationLocale));
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r-- | lib/Format/Format.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 4d401a5be9..c6ff880186 100644 --- a/lib/Format/Format.cpp +++ b/lib/Format/Format.cpp @@ -99,7 +99,7 @@ public: Annotations(Annotations), Replaces(Replaces), StructuralError(StructuralError) { Parameters.PenaltyIndentLevel = 15; - Parameters.PenaltyLevelDecrease = 10; + Parameters.PenaltyLevelDecrease = 30; } /// \brief Formats an \c UnwrappedLine. @@ -369,7 +369,7 @@ private: return Level; if (Right.Tok.is(tok::arrow) || Right.Tok.is(tok::period)) - return 50; + return 150; return 3; } |