]> Cypherpunks repositories - gostls13.git/commit
go/printer: consider empty lines in table layout computation
authorRobert Griesemer <gri@golang.org>
Tue, 14 Aug 2018 00:57:39 +0000 (17:57 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 14 Aug 2018 20:40:15 +0000 (20:40 +0000)
commitc882f4b6b13d4d38d354bec4614d4402031ec1b1
tree7d2a44f6cdcfd8dc88f9250d2df528fbf70728fd
parent469ada6ed9cbf921a268f867d3fde0f311532ff5
go/printer: consider empty lines in table layout computation

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.

A prior fix (https://go-review.googlesource.com/c/go/+/125260, reverted)
introduced another regression (#26930) which this change doesn't produce.

Added test cases for both #26352 and #26930.

Fixes #26352.
Updates #26930.

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