Skip to content

Commit

Permalink
fmt: cleanup comments.v with multiline comment (#20086)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Dec 4, 2023
1 parent c7b7d5f commit 47a8051
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions vlib/v/fmt/comments.v
Expand Up @@ -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(' '))
}
}
Expand Down

0 comments on commit 47a8051

Please sign in to comment.