Skip to content

Commit

Permalink
Move erase to immediately before the paint call
Browse files Browse the repository at this point in the history
Because we're doing a few operations, with type assertions, let's not have them
in between the erase and the paint.
  • Loading branch information
theckman committed Dec 29, 2019
1 parent 5065dcb commit e9409f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spinner.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,11 @@ func (s *Spinner) painter(cancel, sig chan struct{}) {

s.mu.Unlock()

_ = s.erase()

m, d := atomicString(s.message), atomicDuration(s.delayDuration)
cFn := atomicColorFn(s.colorFn)

_ = s.erase()

if err := s.paint(c, m, cFn); err != nil {
panic(fmt.Sprintf("failed to paint line: %v", err))
}
Expand Down

0 comments on commit e9409f5

Please sign in to comment.