tabs for indentation even if -spaces is set.
Changes to gofmt:
- added -tabindent flag
- don't recompute parser and printer mode repeatedly
Changes to go/printer:
- provide new printing mode TabIndent
Changes to tabwriter:
- implement new mode TabIndent to use tabs independent
of the actual padding character for leading empty columns
- distinguish between minimal cell width and tab width
(tabwidth is only used if the output contains tabs,
minwidth and padding are always considered)
- fixed and added more comments
- some additional factoring
By default, -tabindent is disabled and the default gofmt
behavior is unchanged. By setting -spaces and -tabindent,
gofmt will use tabs for indentation but do any other
alignment with spaces. This permits a user to change the
visible indentation by simply changing the editor's tab
width and the code will remain properly aligned without
the need to rerun gofmt.
R=rsc
https://golang.org/cl/163068
the bash scripts and makefiles for building go didn't take into account
the fact $GOROOT / $GOBIN could both be directories containing whitespaces,
and was not possible to build it in such a situation.
this commit adjusts the various makefiles/scripts to make it aware of that
possibility, and now it builds successfully when using a path with whitespaces
as well.
Fixes#115.
R=rsc, dsymonds1
https://golang.org/cl/157067
- enabled for function declarations (not just function literals)
- applied gofmt -w $GOROOT/src
(look for instance at src/pkg/debug/elf/elf.go)
R=r, rsc
CC=go-dev
http://go/go-review/1026006
- soft-tab separated columns can be discarded if empty and DiscardEmptyColumns is set
- hard-tab separated columns are never discarded
R=rsc
DELTA=63 (42 added, 7 deleted, 14 changed)
OCL=35421
CL=35435
in a cell makes a final cell in that line
(this showed up as occasionally missing single spaces in
godoc-formatted declarations that fit on a single line)
2) Cleaned up tabwriter implementation a bit:
- replaced local unicodeLen() with utf8.RuneCount()
- instead of having 2 parallel arrays for line widths and sizes,
have a single array of cells containing a width and size
- factored code a bit better
- added more comments
- added testnames to tabwriter tests
- added more test cases and fixed a broken test case that
now works correctly
R=r
DELTA=279 (133 added, 62 deleted, 84 changed)
OCL=30509
CL=30514