From 13bf1fa6465957f5e2510756fe3ff488a2b370e6 Mon Sep 17 00:00:00 2001 From: Bernard Xie Date: Tue, 20 Jun 2023 13:09:17 -0700 Subject: [PATCH] comments --- d2format/format.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/d2format/format.go b/d2format/format.go index 0a3a6f382..dc7430ec2 100644 --- a/d2format/format.go +++ b/d2format/format.go @@ -331,10 +331,11 @@ func (p *printer) _map(m *d2ast.Map) { // draw board nodes for i := 0; i < len(boards); i++ { 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 { p.newline() } + // if scope only has boards, don't newline the first board if i != 0 || len(m.Nodes) > len(boards) { p.newline() }