Skip to content

Commit

Permalink
Merge pull request #96 from zc2638/fix/render-extra-empty-lines
Browse files Browse the repository at this point in the history
fixed duplicate rendering of extra empty lines
  • Loading branch information
schollz authored Mar 11, 2021
2 parents 520b175 + 255f756 commit 6e80c97
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions progressbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -764,11 +764,10 @@ func clearProgressBar(c config, s state) error {
// write the "clear current line" ANSI escape sequence
return writeString(c, "\033[2K\r")
}
// fill the current line with enough spaces
// fill the empty content
// to overwrite the progress bar and jump
// back to the beginning of the line
str := fmt.Sprintf("\r%s\r", strings.Repeat(" ", s.maxLineWidth))
return writeString(c, str)
return writeString(c, "\r")
}

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

0 comments on commit 6e80c97

Please sign in to comment.