diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2024-06-17 17:00:27 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-06-17 17:00:49 +0900 |
| commit | ed12925f7dbceaedae58b2e202f1b1f443b04ab5 (patch) | |
| tree | bf771d333fd887b914cbe6518f78107e1bd0f9d4 /src | |
| parent | e0ddb97ab49b206ab350618438627b93b5c0c68f (diff) | |
| download | fzf-ed12925f7dbceaedae58b2e202f1b1f443b04ab5.tar.gz | |
--sync: Suppress initial render also when focus event is bound
Diffstat (limited to 'src')
| -rw-r--r-- | src/terminal.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/terminal.go b/src/terminal.go index 895dd8f4..c519c927 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -915,7 +915,7 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor } func (t *Terminal) deferActivation() bool { - return t.initDelay == 0 && (t.hasStartActions || t.hasLoadActions || t.hasResultActions) + return t.initDelay == 0 && (t.hasStartActions || t.hasLoadActions || t.hasResultActions || t.hasFocusActions) } func (t *Terminal) environ() []string { @@ -1237,6 +1237,7 @@ func (t *Terminal) UpdateList(merger *Merger) { t.cy = count - util.Min(count, t.maxItems()) + pos } } + needActivation := false if !t.reading { switch t.merger.Length() { case 0: @@ -1244,6 +1245,8 @@ func (t *Terminal) UpdateList(merger *Merger) { if _, prs := t.keymap[zero]; prs { t.eventChan <- zero } + // --sync, only 'focus' is bound, but no items to focus + needActivation = t.suppress && !t.hasResultActions && !t.hasLoadActions && t.hasFocusActions case 1: one := tui.One.AsEvent() if _, prs := t.keymap[one]; prs { @@ -1257,6 +1260,9 @@ func (t *Terminal) UpdateList(merger *Merger) { t.mutex.Unlock() t.reqBox.Set(reqInfo, nil) t.reqBox.Set(reqList, nil) + if needActivation { + t.reqBox.Set(reqActivate, nil) + } } func (t *Terminal) output() bool { |
