]> Cypherpunks repositories - gostls13.git/commit
go/printer: make empty lines break table alignment
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 20 Jul 2018 20:55:07 +0000 (21:55 +0100)
committerRobert Griesemer <gri@golang.org>
Thu, 9 Aug 2018 18:17:00 +0000 (18:17 +0000)
commitc116265eb3f2b1a8549e7ceef73b780439404030
tree6a6ec20dc6b7850b414ae2e789041843cc0cc8f2
parent666de6c9c429026f51721d2feae44f49845a618c
go/printer: make empty lines break table alignment

In previous versions of Go including 1.10, an empty line would break the
alignment of elements within an expression list.

golang.org/cl/104755 changed the heuristic, with the side effect that
empty lines no longer broke the table alignment.

Reintroduce the behavior and add a regression test for it.

Fixes #26352.

Change-Id: I410bcff4cba25c7f8497d46bd7890a2c7ee11d46
Reviewed-on: https://go-review.googlesource.com/125260
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/printer/nodes.go
src/go/printer/testdata/alignment.golden
src/go/printer/testdata/alignment.input