summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2015-10-13 02:36:11 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2015-10-13 02:36:11 +0900
commitae04f56dbdc9cd635f5a3d56082faf2399d91f75 (patch)
tree5aeffa800d238914ffff215cc13813704e1ccf02
parentf80ff8c9174f1a4bc8ed25dd5dbde8a90dbfe7e5 (diff)
downloadfzf-ae04f56dbdc9cd635f5a3d56082faf2399d91f75.tar.gz
Fix --bind "double-click:execute(...)" (#374)
-rw-r--r--src/terminal.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/terminal.go b/src/terminal.go
index ca4ca212..4f8341da 100644
--- a/src/terminal.go
+++ b/src/terminal.go
@@ -851,16 +851,8 @@ func (t *Terminal) Loop() {
}
}
- action := t.keymap[event.Type]
- mapkey := event.Type
- if event.Type == C.Rune {
- mapkey = int(event.Char) + int(C.AltZ)
- if act, prs := t.keymap[mapkey]; prs {
- action = act
- }
- }
- var doAction func(actionType) bool
- doAction = func(action actionType) bool {
+ var doAction func(actionType, int) bool
+ doAction = func(action actionType, mapkey int) bool {
switch action {
case actIgnore:
case actExecute:
@@ -1043,7 +1035,7 @@ func (t *Terminal) Loop() {
// Double-click
if my >= min {
if t.vset(t.offset+my-min) && t.cy < t.merger.Length() {
- return doAction(t.keymap[C.DoubleClick])
+ return doAction(t.keymap[C.DoubleClick], C.DoubleClick)
}
}
} else if me.Down {
@@ -1062,7 +1054,15 @@ func (t *Terminal) Loop() {
}
return true
}
- if !doAction(action) {
+ action := t.keymap[event.Type]
+ mapkey := event.Type
+ if event.Type == C.Rune {
+ mapkey = int(event.Char) + int(C.AltZ)
+ if act, prs := t.keymap[mapkey]; prs {
+ action = act
+ }
+ }
+ if !doAction(action, mapkey) {
continue
}
changed := string(previousInput) != string(t.input)