mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-15 23:03:47 -05:00
Add --sync option
This commit is contained in:
@@ -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