From 942e44a12023d47f85f04f04130604e8b392b370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20Tr=C3=A9guier?= Date: Wed, 10 Oct 2018 13:55:50 +0200 Subject: [PATCH] Fix #349 - Wrong indentation of access modifier after break of long line --- src/dfmt/formatter.d | 2 ++ tests/allman/issue0349.d.ref | 5 +++++ tests/issue0349.d | 4 ++++ tests/otbs/issue0349.d.ref | 5 +++++ 4 files changed, 16 insertions(+) create mode 100644 tests/allman/issue0349.d.ref create mode 100644 tests/issue0349.d create mode 100644 tests/otbs/issue0349.d.ref diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index b6b3baa..6212b81 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -482,6 +482,8 @@ private: { if (currentIs(tok!";")) { + indents.popWrapIndents(); + indentLevel = indents.indentLevel; writeToken(); if (index >= tokens.length) { diff --git a/tests/allman/issue0349.d.ref b/tests/allman/issue0349.d.ref new file mode 100644 index 0000000..abc6a82 --- /dev/null +++ b/tests/allman/issue0349.d.ref @@ -0,0 +1,5 @@ +import super_long_import_module_name : withSuperLongSymbolNames, + andAlsoLotsOfThem; + +private: +void foo(); diff --git a/tests/issue0349.d b/tests/issue0349.d new file mode 100644 index 0000000..613cceb --- /dev/null +++ b/tests/issue0349.d @@ -0,0 +1,4 @@ +import super_long_import_module_name : withSuperLongSymbolNames, andAlsoLotsOfThem; + +private: +void foo(); diff --git a/tests/otbs/issue0349.d.ref b/tests/otbs/issue0349.d.ref new file mode 100644 index 0000000..abc6a82 --- /dev/null +++ b/tests/otbs/issue0349.d.ref @@ -0,0 +1,5 @@ +import super_long_import_module_name : withSuperLongSymbolNames, + andAlsoLotsOfThem; + +private: +void foo();