m/fzf
1
0
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:
Junegunn Choi
2015-02-13 12:25:19 +09:00
parent ff09c275d4
commit 6c2ce28d0d
5 changed files with 37 additions and 15 deletions

View File

@@ -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
}
}
})
}
}