summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/layouter.nim1
-rw-r--r--nimpretty/tests/expected/simple.nim4
-rw-r--r--nimpretty/tests/simple.nim5
3 files changed, 10 insertions, 0 deletions
diff --git a/compiler/layouter.nim b/compiler/layouter.nim
index 560e8eec7..9ddfbeabc 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 000000000..75f570bac
--- /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 000000000..9e3c52f9b
--- /dev/null
+++ b/nimpretty/tests/simple.nim
@@ -0,0 +1,5 @@
+
+var x: int = 2
+
+echo x
+# bug #9144