1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: keep top level comments on their own lines

This commit is contained in:
Delyan Angelov 2020-07-02 15:21:09 +03:00
parent 29943d7a91
commit 37d51e8d74

View File

@ -1080,7 +1080,7 @@ pub fn (mut f Fmt) comment(node ast.Comment) {
} else {
s = '// ' + s
}
if !is_separate_line {
if !is_separate_line && f.indent > 0 {
f.remove_new_line() // delete the generated \n
f.write(' ')
}