mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-16 23:33:39 -05:00
Add unbound "toggle" action for customization
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user