mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-03 18:34:43 +00:00
nimpretty: fixes #8078
This commit is contained in:
@@ -1148,7 +1148,7 @@ proc skip(L: var TLexer, tok: var TToken) =
|
||||
break
|
||||
tok.strongSpaceA = 0
|
||||
when defined(nimpretty):
|
||||
if buf[pos] == '#': commentIndent = indent
|
||||
if buf[pos] == '#' and tok.line < 0: commentIndent = indent
|
||||
if buf[pos] > ' ' and (buf[pos] != '#' or buf[pos+1] == '#'):
|
||||
tok.indent = indent
|
||||
L.currLineIndent = indent
|
||||
|
||||
@@ -3,3 +3,11 @@ var x: int = 2
|
||||
|
||||
echo x
|
||||
# bug #9144
|
||||
|
||||
proc a() =
|
||||
while true:
|
||||
discard
|
||||
# comment 1
|
||||
|
||||
# comment 2
|
||||
discard
|
||||
|
||||
@@ -3,3 +3,11 @@ var x: int = 2
|
||||
|
||||
echo x
|
||||
# bug #9144
|
||||
|
||||
proc a() =
|
||||
while true:
|
||||
discard
|
||||
# comment 1
|
||||
|
||||
# comment 2
|
||||
discard
|
||||
|
||||
Reference in New Issue
Block a user