This commit is contained in:
Bernard Xie 2023-06-20 13:09:17 -07:00
parent 4bd5642e62
commit 13bf1fa646
No known key found for this signature in database
GPG key ID: 3C3E0036CE0F892C

View file

@ -331,10 +331,11 @@ func (p *printer) _map(m *d2ast.Map) {
// draw board nodes // draw board nodes
for i := 0; i < len(boards); i++ { for i := 0; i < len(boards); i++ {
n := boards[i].Unbox() n := boards[i].Unbox()
// if this board is the very first line of the file, don't add an extra indent // if this board is the very first line of the file, don't add an extra newline
if n.GetRange().Start.Line != 0 { if n.GetRange().Start.Line != 0 {
p.newline() p.newline()
} }
// if scope only has boards, don't newline the first board
if i != 0 || len(m.Nodes) > len(boards) { if i != 0 || len(m.Nodes) > len(boards) {
p.newline() p.newline()
} }