diff --git a/progress.go b/progress.go index a411f8b..82b610c 100644 --- a/progress.go +++ b/progress.go @@ -118,13 +118,15 @@ // it means remove bar now without waiting for its completion. // If bar is already completed, there is nothing to abort. // If you need to remove bar after completion, use BarRemoveOnComplete BarOption. -func (p *Progress) Abort(b *Bar) { +func (p *Progress) Abort(b *Bar, remove bool) { select { case p.operateState <- func(s *pState) { if b.index < 0 { return } - s.heapUpdated = heap.Remove(s.bHeap, b.index) != nil + if remove { + s.heapUpdated = heap.Remove(s.bHeap, b.index) != nil + } s.shutdownPending = append(s.shutdownPending, b) }: case <-p.done: