Skip to content
Myr

Keep the spinner spinning even when the source stream is idle

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent fe4e452 · Browse files · 1 file+15 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+15 added−0 removed

  • other:+15 added−0 removed

1 file+15 added−0 removed

modified:src/terminal.go+15 added
195 unmodified lines
196 pressed: 0,197 printQuery: opts.PrintQuery,198 history: opts.History,199 cycle: opts.Cycle,200 reading: true,201 merger: EmptyMerger,202 selected: make(map[uint32]selectedItem),203 reqBox: util.NewEventBox(),204 eventBox: eventBox,
425 unmodified lines
630 <-resizeChan631 t.reqBox.Set(reqRedraw, nil)632 }633 }()634635 // Keep the spinner spinning636 go func() {637 for {638 t.mutex.Lock()639 reading := t.reading640 t.mutex.Unlock()641 if !reading {642 break643 }644 time.Sleep(spinnerDuration)645 t.reqBox.Set(reqInfo, nil)646 }647 }()648 }649650 exit := func(code int) {651 if code == 0 && t.history != nil {
342 unmodified lines