Fix search not triggered when query change and reload happen at the same time

Fix #3268
This commit is contained in:
Junegunn Choi
2023-04-29 21:27:30 +09:00
parent 5c2f85c39e
commit 77f9f4664a
3 changed files with 17 additions and 2 deletions

View File

@@ -408,6 +408,7 @@ type searchRequest struct {
sort bool
sync bool
command *string
changed bool
}
type previewRequest struct {
@@ -3622,7 +3623,7 @@ func (t *Terminal) Loop() {
t.mutex.Unlock() // Must be unlocked before touching reqBox
if changed || newCommand != nil {
t.eventBox.Set(EvtSearchNew, searchRequest{sort: t.sort, sync: reloadSync, command: newCommand})
t.eventBox.Set(EvtSearchNew, searchRequest{sort: t.sort, sync: reloadSync, command: newCommand, changed: changed})
}
for _, event := range events {
t.reqBox.Set(event, nil)