summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-06-01 13:20:12 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-06-01 13:21:59 +0900
commit41bcbe342ff70020bd7aa776ca041205aa970f43 (patch)
tree8603e35a460fcf7aa466aaa01d64686270ffff7e /src
parentdbe8dc344efbbc7d356cfaf6f807f4be42a45188 (diff)
downloadfzf-41bcbe342ff70020bd7aa776ca041205aa970f43.tar.gz
Revert "An '--expect' key should execute actions bound to the key"
To be backward compatible. Close #3829
Diffstat (limited to 'src')
-rw-r--r--src/terminal.go20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/terminal.go b/src/terminal.go
index 0e945fad..ff6295f1 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -3608,6 +3608,14 @@ func (t *Terminal) Loop() error {
}
t.mutex.Lock()
+ for key, ret := range t.expect {
+ if keyMatch(key, event) {
+ t.pressed = ret
+ t.reqBox.Set(reqClose, nil)
+ t.mutex.Unlock()
+ return nil
+ }
+ }
previousInput := t.input
previousCx := t.cx
t.lastKey = event.KeyName()
@@ -4460,18 +4468,6 @@ func (t *Terminal) Loop() error {
return true
}
- for key, ret := range t.expect {
- if keyMatch(key, event) {
- t.pressed = ret
- if actions, found := t.keymap[key]; found {
- doActions(actions)
- }
- t.reqBox.Set(reqClose, nil)
- t.mutex.Unlock()
- return nil
- }
- }
-
if t.jumping == jumpDisabled || len(actions) > 0 {
// Break out of jump mode if any action is submitted to the server
if t.jumping != jumpDisabled {