diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 63ec50f..ab258c6 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -499,6 +499,9 @@ private: if (peekIs(tok!"(") && (peekBackIs(tok!")") || peekBack2Is(tok!"!"))) pushWrapIndent(tok!"("); + + if (peekIs(tok!".") && !indents.topIs(tok!".")) + indents.push(tok!"."); } writeToken(); immutable j = justAddedExtraNewline; diff --git a/tests/allman/comments.d.ref b/tests/allman/comments.d.ref index 7139949..2e9d54d 100644 --- a/tests/allman/comments.d.ref +++ b/tests/allman/comments.d.ref @@ -2,6 +2,6 @@ int /*sneaky*/ foo( /*comments*/ ) /*everywhere*/ { // comment on its own line foo() // comment on same line - .bar(); // also on same line + .bar(); // also on same line /* again */ // same line } diff --git a/tests/knr/comments.d.ref b/tests/knr/comments.d.ref index 7139949..2e9d54d 100644 --- a/tests/knr/comments.d.ref +++ b/tests/knr/comments.d.ref @@ -2,6 +2,6 @@ int /*sneaky*/ foo( /*comments*/ ) /*everywhere*/ { // comment on its own line foo() // comment on same line - .bar(); // also on same line + .bar(); // also on same line /* again */ // same line } diff --git a/tests/otbs/comments.d.ref b/tests/otbs/comments.d.ref index c809b08..80f5313 100644 --- a/tests/otbs/comments.d.ref +++ b/tests/otbs/comments.d.ref @@ -1,6 +1,6 @@ int /*sneaky*/ foo( /*comments*/ ) /*everywhere*/ { // comment on its own line foo() // comment on same line - .bar(); // also on same line + .bar(); // also on same line /* again */ // same line }