summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2019-07-03 18:55:15 +0200
committerGitHub <noreply@github.com>2019-07-03 18:55:15 +0200
commit0718d6c2cddac89256e2fcde17407f1685f1a457 (patch)
tree44bc170e4b22a69ebdba564ad669e78920152e6f /compiler
parent045eeab6b4eb95f855ffe73faa5de99a37e1cf74 (diff)
downloadNim-0718d6c2cddac89256e2fcde17407f1685f1a457.tar.gz
[bugfix] fix wrong nimpretty unidents, refs #11616 (#11645)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/layouter.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/layouter.nim b/compiler/layouter.nim
index e45e6400a..b2764b3eb 100644
--- a/compiler/layouter.nim
+++ b/compiler/layouter.nim
@@ -364,7 +364,7 @@ proc emitTok*(em: var Emitter; L: TLexer; tok: TToken) =
       em.indentLevel = tok.indent
     elif (em.lastTok in (splitters + oprSet) and tok.tokType notin closedPars):
       # aka: we are in an expression context:
-      let alignment = tok.indent - em.indentStack[^1]
+      let alignment = max(tok.indent - em.indentStack[^1], 0)
       em.indentLevel = alignment + em.indentStack.high * em.indWidth
     else:
       if tok.indent > em.indentStack[^1]: