printer: fix newline for standalone comments
This commit is contained in:
parent
858f6116bf
commit
566c59bf69
@ -116,7 +116,11 @@ func (p *printer) output(n interface{}) []byte {
|
||||
|
||||
buf.WriteString(comment.Text)
|
||||
// TODO(arslan): do not print new lines if the comments are one liner
|
||||
buf.Write([]byte{newline, newline})
|
||||
|
||||
buf.WriteByte(newline)
|
||||
if index != len(t.Items) {
|
||||
buf.WriteByte(newline)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
1
printer/testdata/comment_standalone.golden
vendored
1
printer/testdata/comment_standalone.golden
vendored
@ -14,4 +14,3 @@ aligned = {
|
||||
numbers = [1, 2] // another line here
|
||||
|
||||
# Standalone 4
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user