@@ -20,6 +20,12 @@ import (
|
20 | 20 | "unicode/utf8" |
21 | 21 | ) |
22 | 22 | |
| 23 | +const ( |
| 24 | +punchedCardWidth = 80 // These things just won't leave us alone. |
| 25 | +indentedWidth = punchedCardWidth - len(indent) |
| 26 | +indent = " " |
| 27 | +) |
| 28 | + |
23 | 29 | type Package struct { |
24 | 30 | writer io.Writer // Destination for output. |
25 | 31 | name string // Package name, json for encoding/json. |
@@ -135,7 +141,7 @@ func (pkg *Package) emit(comment string, node ast.Node) {
|
135 | 141 | } |
136 | 142 | if comment != "" { |
137 | 143 | pkg.newlines(2) // Guarantee blank line before comment. |
138 | | -doc.ToText(&pkg.buf, comment, " ", "\t", 80) |
| 144 | +doc.ToText(&pkg.buf, comment, " ", indent, indentedWidth) |
139 | 145 | } |
140 | 146 | pkg.newlines(1) |
141 | 147 | } |
@@ -204,7 +210,7 @@ func (pkg *Package) packageDoc() {
|
204 | 210 | pkg.packageClause(false) |
205 | 211 | } |
206 | 212 | |
207 | | -doc.ToText(&pkg.buf, pkg.doc.Doc, "", "\t", 80) |
| 213 | +doc.ToText(&pkg.buf, pkg.doc.Doc, "", indent, indentedWidth) |
208 | 214 | pkg.newlines(1) |
209 | 215 | |
210 | 216 | if !pkg.showInternals() { |
|