From 34810aa92874b9f70d5167ecb2773747de9c99b5 Mon Sep 17 00:00:00 2001 From: Jan Jurzitza Date: Fri, 3 Apr 2020 09:19:24 +0200 Subject: [PATCH] Fix stuck-while TODO (this is a do-while loop) --- src/dfmt/formatter.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 158ae00..6f9b7cc 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -1851,6 +1851,7 @@ private: immutable int startingNiBraceDepth = niBraceDepth; immutable int startingSBraceDepth = sBraceDepth; parenDepth = 0; + do { spaceAfterParens = spaceAfter; @@ -1873,8 +1874,8 @@ private: else formatStep(); } - // TODO: obviously getting stuck here? while (hasCurrent && parenDepth > 0); + if (indents.topIs(tok!"!")) indents.pop(); parenDepth = depth;