summary refs log tree commit diff stats
path: root/compiler/lexer.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/lexer.nim')
-rw-r--r--compiler/lexer.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index 1d9279d02..a4a2615bd 100644
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -1080,7 +1080,9 @@ proc rawGetTok*(L: var TLexer, tok: var TToken) =
     tok.indent = -1
   skip(L, tok)
   when defined(nimpretty):
-    if tok.tokType == tkComment: return
+    if tok.tokType == tkComment:
+      L.indentAhead = L.currLineIndent
+      return
   var c = L.buf[L.bufpos]
   tok.line = L.lineNumber
   tok.col = getColNumber(L, L.bufpos)