diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/layouter.nim | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/layouter.nim b/compiler/layouter.nim index 7df32ec4c..0c888b455 100644 --- a/compiler/layouter.nim +++ b/compiler/layouter.nim @@ -441,6 +441,9 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) = em.indentLevel = tok.indent elif (em.lastTok in (splitters + oprSet) and tok.tokType notin (closedPars - {tkBracketDotRi})): + if tok.tokType in openPars and tok.indent > em.indentStack[^1]: + while em.indentStack[^1] < tok.indent: + em.indentStack.add(em.indentStack[^1] + em.indWidth) # aka: we are in an expression context: let alignment = max(tok.indent - em.indentStack[^1], 0) em.indentLevel = alignment + em.indentStack.high * em.indWidth |