Skip to content

Commit

Permalink
revert 255f756 because it does not work
Browse files Browse the repository at this point in the history
when the subsequent lines are shorter
  • Loading branch information
schollz committed Mar 15, 2021
1 parent 6e80c97 commit 3e6b9bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion progressbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,10 @@ func clearProgressBar(c config, s state) error {
// fill the empty content
// to overwrite the progress bar and jump
// back to the beginning of the line
return writeString(c, "\r")
str := fmt.Sprintf("\r%s\r", strings.Repeat(" ", s.maxLineWidth))
return writeString(c, str)
// the following does not show correctly if the previous line is longer than subsequent line
// return writeString(c, "\r")
}

func writeString(c config, str string) error {
Expand Down

0 comments on commit 3e6b9bf

Please sign in to comment.