Add unbound "toggle" action for customization

pull/242/head
Junegunn Choi 9 years ago
parent 34946b72a5
commit 801cf9ac62

@ -181,12 +181,13 @@ e.g. \fBfzf --bind=ctrl-j:accept,ctrl-k:kill-line\fR
end-of-line
forward-char
forward-word
kill-line
kill-line (not bound)
kill-word
page-down
page-up
toggle (not bound)
toggle-down
toggle-sort
toggle-sort (not bound; equivalent to \fB--toggle-sort\fR)
toggle-up
unix-line-discard
unix-word-rubout

@ -344,6 +344,8 @@ func parseKeymap(keymap map[int]actionType, toggleSort bool, str string) (map[in
keymap[key] = actToggleDown
case "toggle-up":
keymap[key] = actToggleUp
case "toggle":
keymap[key] = actToggle
case "down":
keymap[key] = actDown
case "up":

@ -105,6 +105,7 @@ const (
actUnixWordRubout
actYank
actBackwardKillWord
actToggle
actToggleDown
actToggleUp
actDown
@ -724,6 +725,11 @@ func (t *Terminal) Loop() {
t.input = append(t.input[:t.cx-1], t.input[t.cx:]...)
t.cx--
}
case actToggle:
if t.multi && t.merger.Length() > 0 {
toggle()
req(reqList)
}
case actToggleDown:
if t.multi && t.merger.Length() > 0 {
toggle()

Loading…
Cancel
Save