Skip to content

Commit

Permalink
fixed duplicate rendering of extra empty lines
Browse files Browse the repository at this point in the history
  • Loading branch information
zc2638 committed Mar 11, 2021
1 parent 520b175 commit 255f756
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 255f756

Please sign in to comment.