nimpretty: fixes #8078
This commit is contained in:
parent
e3a0415650
commit
3ee53a7c8e
3 changed files with 17 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue