Add unbound "toggle" action for customization

This commit is contained in:
Junegunn Choi 2015-05-21 01:35:35 +09:00
parent 34946b72a5
commit 801cf9ac62
3 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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":

View File

@ -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()