m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Add 'one' event

Close #2629
Close #2494
Close #459
This commit is contained in:
Junegunn Choi
2023-04-01 17:16:02 +09:00
parent 1c7534f009
commit 8ec917b1c3
6 changed files with 39 additions and 0 deletions

View File

@@ -622,6 +622,8 @@ func parseKeyChordsImpl(str string, message string, exit func(string)) map[tui.E
add(tui.Load)
case "focus":
add(tui.Focus)
case "one":
add(tui.One)
case "alt-enter", "alt-return":
chords[tui.CtrlAltKey('m')] = key
case "alt-space":

View File

@@ -932,6 +932,12 @@ func (t *Terminal) UpdateList(merger *Merger, reset bool) {
t.cy = count - util.Min(count, t.maxItems()) + pos
}
}
if !t.reading && t.merger.Length() == 1 {
one := tui.One.AsEvent()
if _, prs := t.keymap[one]; prs {
t.eventChan <- one
}
}
t.mutex.Unlock()
t.reqBox.Set(reqInfo, nil)
t.reqBox.Set(reqList, nil)

View File

@@ -93,6 +93,7 @@ const (
Start
Load
Focus
One
AltBS