Export FZF_* variables to 'reload' process as well

This commit is contained in:
Junegunn Choi
2024-02-15 22:27:32 +09:00
parent 425deadca9
commit 5e6788c679
4 changed files with 26 additions and 11 deletions

View File

@@ -499,6 +499,7 @@ type searchRequest struct {
sort bool
sync bool
command *string
environ []string
changed bool
}
@@ -4081,10 +4082,15 @@ func (t *Terminal) Loop() {
req(reqPrompt)
}
reload := changed || newCommand != nil
var reloadRequest *searchRequest
if reload {
reloadRequest = &searchRequest{sort: t.sort, sync: reloadSync, command: newCommand, environ: t.environ(), changed: changed}
}
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, changed: changed})
if reload {
t.eventBox.Set(EvtSearchNew, *reloadRequest)
}
for _, event := range events {
t.reqBox.Set(event, nil)