diff --git a/compiler/layouter.nim b/compiler/layouter.nim index 560e8eec75..9ddfbeabcd 100644 --- a/compiler/layouter.nim +++ b/compiler/layouter.nim @@ -52,6 +52,7 @@ proc openEmitter*(em: var Emitter, cache: IdentCache; em.content = newStringOfCap(16_000) em.indentStack = newSeqOfCap[int](30) em.indentStack.add 0 + em.lastLineNumber = 1 proc closeEmitter*(em: var Emitter) = var f = llStreamOpen(em.config.outFile, fmWrite) diff --git a/nimpretty/tests/expected/simple.nim b/nimpretty/tests/expected/simple.nim new file mode 100644 index 0000000000..75f570bac1 --- /dev/null +++ b/nimpretty/tests/expected/simple.nim @@ -0,0 +1,4 @@ + +var x: int = 2 + +echo x # bug #9144 diff --git a/nimpretty/tests/simple.nim b/nimpretty/tests/simple.nim new file mode 100644 index 0000000000..9e3c52f9bd --- /dev/null +++ b/nimpretty/tests/simple.nim @@ -0,0 +1,5 @@ + +var x: int = 2 + +echo x +# bug #9144