mirror of
https://github.com/vlang/v.git
synced 2025-09-18 03:46:36 -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()
|
||||
f.write('/*')
|
||||
for i, line in lines {
|
||||
f.empty_line = false
|
||||
if i == lines.len - 1 {
|
||||
f.empty_line = false
|
||||
f.write(line)
|
||||
if node.text[node.text.len - 1] == `\n` {
|
||||
f.writeln(line)
|
||||
} else {
|
||||
f.write(line)
|
||||
f.writeln('')
|
||||
}
|
||||
f.write('*/')
|
||||
} else {
|
||||
f.empty_line = false
|
||||
f.writeln(line.trim_right(' '))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user