mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-18 00:03:39 -05:00
Add 'multi' event triggered on multi-selection changes
This commit is contained in:
@@ -1008,6 +1008,8 @@ func parseKeyChordsImpl(str string, message string) (map[tui.Event]string, error
|
||||
add(tui.JumpCancel)
|
||||
case "click-header":
|
||||
add(tui.ClickHeader)
|
||||
case "multi":
|
||||
add(tui.Multi)
|
||||
case "alt-enter", "alt-return":
|
||||
chords[tui.CtrlAltKey('m')] = key
|
||||
case "alt-space":
|
||||
@@ -1561,7 +1563,7 @@ func parseActionList(masked string, original string, prevActions []*action, putA
|
||||
appendAction(actCancel)
|
||||
case "clear-query":
|
||||
appendAction(actClearQuery)
|
||||
case "clear-selection":
|
||||
case "clear-multi", "clear-selection":
|
||||
appendAction(actClearSelection)
|
||||
case "forward-char":
|
||||
appendAction(actForwardChar)
|
||||
|
||||
@@ -5399,6 +5399,7 @@ func (t *Terminal) Loop() error {
|
||||
}
|
||||
previousInput := t.input
|
||||
previousCx := t.cx
|
||||
previousVersion := t.version
|
||||
t.lastKey = event.KeyName()
|
||||
updatePreviewWindow := func(forcePreview bool) {
|
||||
t.resizeWindows(forcePreview, false)
|
||||
@@ -6656,6 +6657,9 @@ func (t *Terminal) Loop() error {
|
||||
if onEOFs, prs := t.keymap[tui.BackwardEOF.AsEvent()]; beof && prs && !doActions(onEOFs) {
|
||||
continue
|
||||
}
|
||||
if onMultis, prs := t.keymap[tui.Multi.AsEvent()]; t.version != previousVersion && prs && !doActions(onMultis) {
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
jumpEvent := tui.JumpCancel
|
||||
if event.Type == tui.Rune {
|
||||
|
||||
@@ -132,6 +132,7 @@ const (
|
||||
Jump
|
||||
JumpCancel
|
||||
ClickHeader
|
||||
Multi
|
||||
)
|
||||
|
||||
func (t EventType) AsEvent() Event {
|
||||
|
||||
Reference in New Issue
Block a user