Merge pull request #708 from peco/fix-draw-ticker-constant

Extract drawRefreshInterval constant
This commit is contained in:
lestrrat 2026-02-18 16:03:19 +09:00 committed by GitHub
commit 3df337e1f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,6 +14,10 @@ import (
"github.com/peco/peco/pipeline"
)
// drawRefreshInterval is the interval at which the screen is redrawn while
// reading input. This provides visual feedback as new lines arrive.
const drawRefreshInterval = 100 * time.Millisecond
// NewSource creates a new Source. Does not start processing the input until you
// call Setup()
func NewSource(name string, in io.Reader, isInfinite bool, idgen line.IDGenerator, capacity int, enableSep bool, enableANSI bool) *Source {
@ -63,7 +67,7 @@ func (s *Source) Setup(ctx context.Context, state *Peco) {
}
go func() {
ticker := time.NewTicker(100 * time.Millisecond)
ticker := time.NewTicker(drawRefreshInterval)
defer ticker.Stop()
for {