Skip to content
Myr

Fix --bind "double-click:execute(...)" (#374)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent f80ff8c · Browse files · 1 file+12 added−12 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+12 added−12 removed

  • other:+12 added−12 removed

1 file+12 added−12 removed

modified:src/terminal.go+12 added-12 removed
849 unmodified lines
850 break851 }852 }853854 action := t.keymap[event.Type]855 mapkey := event.Type856 if event.Type == C.Rune {857 mapkey = int(event.Char) + int(C.AltZ)858 if act, prs := t.keymap[mapkey]; prs {859 action = act860 }861 }862 var doAction func(actionType) bool863 doAction = func(action actionType) bool {854 var doAction func(actionType, int) bool855 doAction = func(action actionType, mapkey int) bool {856 switch action {857 case actIgnore:858 case actExecute:859 if t.cy >= 0 && t.cy < t.merger.Length() {
174 unmodified lines
1034 if me.Double {1035 // Double-click1036 if my >= min {1037 if t.vset(t.offset+my-min) && t.cy < t.merger.Length() {1046 return doAction(t.keymap[C.DoubleClick])1038 return doAction(t.keymap[C.DoubleClick], C.DoubleClick)1039 }1040 }1041 } else if me.Down {1042 if my == 0 && mx >= 0 {
10 unmodified lines
1053 }1054 }1055 return true1056 }1057 action := t.keymap[event.Type]1058 mapkey := event.Type1059 if event.Type == C.Rune {1060 mapkey = int(event.Char) + int(C.AltZ)1061 if act, prs := t.keymap[mapkey]; prs {1062 action = act1063 }1064 }1065 if !doAction(action) {1065 if !doAction(action, mapkey) {1066 continue1067 }1068 changed := string(previousInput) != string(t.input)1069 t.mutex.Unlock() // Must be unlocked before touching reqBox
65 unmodified lines