m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

Add 'best' action

This commit is contained in:
Junegunn Choi
2025-10-08 11:08:12 +09:00
parent ed7becfb47
commit d19ce0ad8d
5 changed files with 68 additions and 22 deletions

View File

@@ -663,6 +663,7 @@ const (
actExecuteSilent
actExecuteMulti // Deprecated
actSigStop
actBest
actFirst
actLast
actReload
@@ -6203,8 +6204,14 @@ func (t *Terminal) Loop() error {
t.version++
req(reqList, reqInfo)
}
case actFirst:
t.vset(0)
case actFirst, actBest:
if t.raw && a.t == actBest {
if t.resultMerger.Length() > 0 {
t.vset(t.merger.FindIndex(t.resultMerger.Get(0).item.Index()))
}
} else {
t.vset(0)
}
t.constrain()
req(reqList)
case actLast: