Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/doc: incorrect text wrapping on 80 column terminals #11639

Closed
xi2 opened this issue Jul 9, 2015 · 2 comments
Closed

cmd/doc: incorrect text wrapping on 80 column terminals #11639

xi2 opened this issue Jul 9, 2015 · 2 comments
Milestone

Comments

@xi2
Copy link

xi2 commented Jul 9, 2015

I use cmd/doc on an 80 column terminal and I find it doesn't wrap correctly. For example:

$ doc os.truncate
func Truncate(name string, size int64) error

    Truncate changes the size of the named file. If the file is a symbolic link,
 it
    changes the size of the link's target. If there is an error, it will be of t
ype
    *PathError.

The following patch seems to fix it for me:

--- a/src/cmd/doc/pkg.go
+++ b/src/cmd/doc/pkg.go
@@ -135,7 +135,7 @@
                }
                if comment != "" {
                        pkg.newlines(2) // Guarantee blank line before comment.
-                       doc.ToText(&pkg.buf, comment, "    ", "\t", 80)
+                       doc.ToText(&pkg.buf, comment, "    ", "\t", 76)
                }
                pkg.newlines(1)
        }

I then get:

func Truncate(name string, size int64) error

    Truncate changes the size of the named file. If the file is a symbolic link,
    it changes the size of the link's target. If there is an error, it will be
    of type *PathError.
@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jul 9, 2015
@robpike
Copy link
Contributor

robpike commented Jul 10, 2015

I find it really really hard to care about this, but you're probably right that it should be changed.

I have not used keypunch cards for almost 40 years but their influence on my life is incessant and overbearing.

@gopherbot
Copy link

CL https://golang.org/cl/12011 mentions this issue.

@mikioh mikioh modified the milestones: Go1.5, Go1.6 Jul 10, 2015
@golang golang locked and limited conversation to collaborators Jul 11, 2016
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants