diff --git a/pkg/mux/screen/replay/search.go b/pkg/mux/screen/replay/search.go index 8ffe31b2..006547a8 100644 --- a/pkg/mux/screen/replay/search.go +++ b/pkg/mux/screen/replay/search.go @@ -99,6 +99,10 @@ func (r *Replay) waitProgress() tea.Cmd { } func (r *Replay) handleSearchResult(msg SearchResultEvent) (taro.Model, tea.Cmd) { + if r.isWaiting != true { + return r, nil + } + r.isWaiting = false // TODO(cfoust): 10/13/23 handle error diff --git a/pkg/mux/screen/replay/update.go b/pkg/mux/screen/replay/update.go index ed3e2845..721a4f77 100644 --- a/pkg/mux/screen/replay/update.go +++ b/pkg/mux/screen/replay/update.go @@ -99,6 +99,12 @@ func (r *Replay) Update(msg tea.Msg) (taro.Model, tea.Cmd) { r.isPlaying = false switch msg.Type { case ActionQuit: + // Ignore an in-progress search + if r.isWaiting { + r.isWaiting = false + return r, nil + } + if r.isCopyMode() { if r.isSelecting { r.isSelecting = false @@ -130,6 +136,10 @@ func (r *Replay) Update(msg tea.Msg) (taro.Model, tea.Cmd) { case ActionSearchAgain, ActionSearchReverse: r.searchAgain(msg.Type != ActionSearchReverse) case ActionSearchForward, ActionSearchBackward: + if r.isWaiting { + return r, nil + } + r.mode = ModeInput r.isForward = msg.Type == ActionSearchForward r.searchInput.Reset()