mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-13 19:25:47 -07:00
Fix --bind "double-click:execute(...)" (#374)
This commit is contained in:
@@ -851,16 +851,8 @@ func (t *Terminal) Loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
action := t.keymap[event.Type]
|
var doAction func(actionType, int) bool
|
||||||
mapkey := event.Type
|
doAction = func(action actionType, mapkey int) bool {
|
||||||
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 {
|
|
||||||
switch action {
|
switch action {
|
||||||
case actIgnore:
|
case actIgnore:
|
||||||
case actExecute:
|
case actExecute:
|
||||||
@@ -1043,7 +1035,7 @@ func (t *Terminal) Loop() {
|
|||||||
// Double-click
|
// Double-click
|
||||||
if my >= min {
|
if my >= min {
|
||||||
if t.vset(t.offset+my-min) && t.cy < t.merger.Length() {
|
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 {
|
} else if me.Down {
|
||||||
@@ -1062,7 +1054,15 @@ func (t *Terminal) Loop() {
|
|||||||
}
|
}
|
||||||
return true
|
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
|
continue
|
||||||
}
|
}
|
||||||
changed := string(previousInput) != string(t.input)
|
changed := string(previousInput) != string(t.input)
|
||||||
|
Reference in New Issue
Block a user