mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-03 03:32:32 +00:00
* [bugfix] fix #11469, new rules for a newline in nimpretty
* concatenate two lines if they have the same indentation level
(cherry picked from commit f288e1b11a)
74 lines
682 B
Nim
74 lines
682 B
Nim
|
|
# bug #9505
|
|
|
|
import std/[
|
|
strutils, ospaths, os
|
|
]
|
|
import pkg/[
|
|
regex
|
|
]
|
|
|
|
proc fun() =
|
|
let a = [
|
|
1,
|
|
2,
|
|
]
|
|
discard
|
|
|
|
proc funB() =
|
|
let a = [
|
|
1,
|
|
2,
|
|
3
|
|
]
|
|
discard
|
|
|
|
|
|
# bug #10156
|
|
proc foo =
|
|
## Comment 1
|
|
## Comment 2
|
|
discard
|
|
|
|
proc bar =
|
|
## Comment 3
|
|
## Comment 4
|
|
## More here.
|
|
discard
|
|
|
|
|
|
proc barB =
|
|
# Comment 5
|
|
# Comment 6
|
|
discard
|
|
|
|
|
|
var x: int = 2
|
|
|
|
echo x
|
|
# bug #9144
|
|
|
|
proc a() =
|
|
if cond:
|
|
while true:
|
|
discard
|
|
# comment 1
|
|
# end while
|
|
#end if
|
|
|
|
# comment 2
|
|
#if
|
|
#case
|
|
#end case
|
|
#end if
|
|
discard
|
|
|
|
|
|
proc a() =
|
|
while true:
|
|
discard
|
|
# comment 1
|
|
|
|
# comment 2
|
|
discard
|