]> Cypherpunks repositories - gostls13.git/commit
go/printer, gofmt: fix multi-line logic
authorRobert Griesemer <gri@golang.org>
Tue, 13 Mar 2012 23:15:58 +0000 (16:15 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 13 Mar 2012 23:15:58 +0000 (16:15 -0700)
commitb5021f3fe0163ddad2681cd76402f15fa17cff56
tree6197eeb30b6a822e7b96380a34baeddc9fbf48b5
parent62bb39e2baad708c3910abc6b5b51c49f91418d4
go/printer, gofmt: fix multi-line logic

A node spans multiple lines if the line difference
between start and end point is > 0 (rather than > 1).
Fixes some odd cases introduced by CL 5706055;
pointed out by dsymonds.

Added corresponding test case. The other change
in the .golden file reverts to the status before
the CL mentioned above and is correct.

gofmt -w src misc changes godoc.go back to where
it was before the CL mentioned above.

Fixes #3304.

R=dsymonds, rsc
CC=golang-dev
https://golang.org/cl/5820044
src/cmd/godoc/godoc.go
src/pkg/go/printer/nodes.go
src/pkg/go/printer/testdata/declarations.golden
src/pkg/go/printer/testdata/declarations.input