mirror of
https://github.com/junegunn/fzf.git
synced 2026-10-30 10:05:58 +00:00
Add --sync option
This commit is contained in:
1 parent
ff09c275d4
commit
6c2ce28d0d
5 files changed
+37
-15
No files matched your search
@@ -78,3 +78,18 @@ func (b *EventBox) Unwatch(events ...EventType) {
|
||||
b.ignore[event] = true
|
||||
}
|
||||
}
|
||||
|
||||
func (b *EventBox) WaitFor(event EventType) {
|
||||
looping := true
|
||||
for looping {
|
||||
b.Wait(func(events *Events) {
|
||||
for evt := range *events {
|
||||
switch evt {
|
||||
case event:
|
||||
looping = false
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user