mirror of
https://github.com/peco/peco.git
synced 2026-09-10 07:16:29 -04:00
commit
6058cbee57
|
|
@ -163,11 +163,6 @@ func (h *Hub) SendDraw(ctx context.Context, options *DrawOptions) {
|
|||
send(ctx, h.DrawCh(), NewPayload(options, isBatchCtx(ctx)))
|
||||
}
|
||||
|
||||
// SendPurgeDisplayCache sends a request to purge the display cache
|
||||
func (h *Hub) SendPurgeDisplayCache(ctx context.Context) {
|
||||
send(ctx, h.DrawCh(), NewPayload(&DrawOptions{PurgeCache: true}, isBatchCtx(ctx)))
|
||||
}
|
||||
|
||||
// StatusMsgCh returns the channel to update the status message
|
||||
func (h *Hub) StatusMsgCh() chan *Payload[StatusMsg] {
|
||||
return h.statusMsgCh
|
||||
|
|
|
|||
|
|
@ -468,11 +468,10 @@ type Buffer interface {
|
|||
|
||||
// MemoryBuffer is an implementation of Buffer
|
||||
type MemoryBuffer struct {
|
||||
done chan struct{}
|
||||
doneOnce sync.Once
|
||||
lines []line.Line
|
||||
mutex sync.RWMutex
|
||||
PeriodicFunc func()
|
||||
done chan struct{}
|
||||
doneOnce sync.Once
|
||||
lines []line.Line
|
||||
mutex sync.RWMutex
|
||||
}
|
||||
|
||||
type ActionMap interface {
|
||||
|
|
|
|||
|
|
@ -22,24 +22,6 @@ func QueryFromContext(ctx context.Context) string {
|
|||
return v
|
||||
}
|
||||
|
||||
func NilOutput(ctx context.Context) ChanOutput {
|
||||
ch := make(chan line.Line)
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
return
|
||||
case _, ok := <-ch:
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
return ChanOutput(ch)
|
||||
}
|
||||
|
||||
// OutCh returns the channel that acceptors can listen to
|
||||
func (oc ChanOutput) OutCh() <-chan line.Line {
|
||||
return oc
|
||||
|
|
|
|||
5
state.go
5
state.go
|
|
@ -20,11 +20,6 @@ func (s *SingleKeyJumpState) Mode() bool {
|
|||
return s.mode
|
||||
}
|
||||
|
||||
// SetMode sets single-key jump mode on or off.
|
||||
func (s *SingleKeyJumpState) SetMode(b bool) {
|
||||
s.mode = b
|
||||
}
|
||||
|
||||
// ShowPrefix returns whether jump prefixes should be displayed.
|
||||
func (s *SingleKeyJumpState) ShowPrefix() bool {
|
||||
return s.showPrefix
|
||||
|
|
|
|||
Loading…
Reference in a new issue