From c8748a736e1279511123f8e1ea967cacc385e840 Mon Sep 17 00:00:00 2001 From: Daisuke Maki Date: Wed, 18 Feb 2026 15:53:51 +0900 Subject: [PATCH] Extract drawRefreshInterval constant --- source.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source.go b/source.go index 9d29bea..010d1e0 100644 --- a/source.go +++ b/source.go @@ -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 {