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

wrap: Avoid trailing whitespace for empty lines #1513

Merged
merged 5 commits into from Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion help.go
Expand Up @@ -476,7 +476,9 @@ func wrap(input string, offset int, wrapAt int) string {

for i, line := range lines {
if i != 0 {
sb.WriteString(padding)
if len(line) > 0 {
abitrolly marked this conversation as resolved.
Show resolved Hide resolved
sb.WriteString(padding)
}
}

sb.WriteString(wrapLine(line, offset, wrapAt, padding))
Expand Down
6 changes: 3 additions & 3 deletions help_test.go
Expand Up @@ -1276,7 +1276,7 @@ DESCRIPTION:
App.Description string long
enough that it should be
wrapped in this test

with a newline
and an indented line

Expand All @@ -1294,8 +1294,8 @@ COPYRIGHT:
that it should be wrapped.
Including newlines.
And also indented lines.


And then another long line.
Blah blah blah does anybody
ever read these things?
Expand Down