From c522a455df3817d98c2cd9132668c4eb9fbb0d88 Mon Sep 17 00:00:00 2001 From: Miran Date: Tue, 2 Jul 2019 10:52:46 +0200 Subject: [bugfix] nimpretty indents multiline comments correctly (#11607) --- compiler/layouter.nim | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/layouter.nim') diff --git a/compiler/layouter.nim b/compiler/layouter.nim index 546d4766e..e45e6400a 100644 --- a/compiler/layouter.nim +++ b/compiler/layouter.nim @@ -145,6 +145,10 @@ proc closeEmitter*(em: var Emitter) = maxLhs = 0 lineBegin = i+1 of ltTab: + if i >= 2 and em.kinds[i-2] == ltNewline and em.kinds[i-1] in {ltNewline, ltSpaces}: + # a previous section has ended + maxLhs = 0 + if maxLhs == 0: content.add em.tokens[i] inc lineLen, em.tokens[i].len -- cgit 1.4.1-2-gfad0