m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-16 15:23:48 -05:00

Add rebind action for restoring bindings after unbind

Fix #2752
Close #2564
This commit is contained in:
Junegunn Choi
2022-04-04 21:54:22 +09:00
parent f8b713f425
commit d56f605b63
7 changed files with 39 additions and 11 deletions

View File

@@ -242,9 +242,11 @@ func Run(opts *Options, version string, revision string) {
for {
delay := true
ticks++
input := func() []rune {
input := func(reloaded bool) []rune {
paused, input := terminal.Input()
if !paused {
if reloaded && paused {
query = []rune{}
} else if !paused {
query = input
}
return query
@@ -274,7 +276,8 @@ func Run(opts *Options, version string, revision string) {
opts.Sync = false
terminal.UpdateList(PassMerger(&snapshot, opts.Tac), false)
}
matcher.Reset(snapshot, input(), false, !reading, sort, clearCache())
reset := clearCache()
matcher.Reset(snapshot, input(reset), false, !reading, sort, reset)
case EvtSearchNew:
var command *string
@@ -293,7 +296,8 @@ func Run(opts *Options, version string, revision string) {
break
}
snapshot, _ := chunkList.Snapshot()
matcher.Reset(snapshot, input(), true, !reading, sort, clearCache())
reset := clearCache()
matcher.Reset(snapshot, input(reset), true, !reading, sort, reset)
delay = false
case EvtSearchProgress: