mirror of
https://github.com/vlang/v.git
synced 2025-09-19 04:17:46 -04:00
fmt: cleanup comments.v with multiline comment (#20086)
This commit is contained in:
parent
c7b7d5f50f
commit
47a8051b13
@ -61,16 +61,14 @@ pub fn (mut f Fmt) comment(node ast.Comment, options CommentsOptions) {
|
|||||||
lines := node.text.split_into_lines()
|
lines := node.text.split_into_lines()
|
||||||
f.write('/*')
|
f.write('/*')
|
||||||
for i, line in lines {
|
for i, line in lines {
|
||||||
|
f.empty_line = false
|
||||||
if i == lines.len - 1 {
|
if i == lines.len - 1 {
|
||||||
f.empty_line = false
|
f.write(line)
|
||||||
if node.text[node.text.len - 1] == `\n` {
|
if node.text[node.text.len - 1] == `\n` {
|
||||||
f.writeln(line)
|
f.writeln('')
|
||||||
} else {
|
|
||||||
f.write(line)
|
|
||||||
}
|
}
|
||||||
f.write('*/')
|
f.write('*/')
|
||||||
} else {
|
} else {
|
||||||
f.empty_line = false
|
|
||||||
f.writeln(line.trim_right(' '))
|
f.writeln(line.trim_right(' '))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user