diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2023-04-01 17:16:02 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2023-04-01 17:25:47 +0900 |
commit | 8ec917b1c36ed1cf6ace64419307aa85fda4bee3 (patch) | |
tree | 74d6f5e0e59a82ad13f0d51cd51aa8ee34c36025 /src | |
parent | 1c7534f00966edca7c44054af199ca27aca0a80c (diff) |
Add 'one' event
Close #2629
Close #2494
Close #459
Diffstat (limited to 'src')
-rw-r--r-- | src/options.go | 2 | ||||
-rw-r--r-- | src/terminal.go | 6 | ||||
-rw-r--r-- | src/tui/tui.go | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/options.go b/src/options.go index 36ca7710..8703c0ec 100644 --- a/src/options.go +++ b/src/options.go @@ -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": diff --git a/src/terminal.go b/src/terminal.go index 57ff4f54..5ecba97b 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -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) diff --git a/src/tui/tui.go b/src/tui/tui.go index 3d67c489..b8b7ae6a 100644 --- a/src/tui/tui.go +++ b/src/tui/tui.go @@ -93,6 +93,7 @@ const ( Start Load Focus + One AltBS |