|
|
@ -3,6 +3,7 @@ package fzf
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"sync"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
"unsafe"
|
|
|
|
"unsafe"
|
|
|
|
|
|
|
|
|
|
|
@ -164,14 +165,17 @@ func Run(opts *Options, version string, revision string) {
|
|
|
|
found := false
|
|
|
|
found := false
|
|
|
|
if streamingFilter {
|
|
|
|
if streamingFilter {
|
|
|
|
slab := util.MakeSlab(slab16Size, slab32Size)
|
|
|
|
slab := util.MakeSlab(slab16Size, slab32Size)
|
|
|
|
|
|
|
|
mutex := sync.Mutex{}
|
|
|
|
reader := NewReader(
|
|
|
|
reader := NewReader(
|
|
|
|
func(runes []byte) bool {
|
|
|
|
func(runes []byte) bool {
|
|
|
|
item := Item{}
|
|
|
|
item := Item{}
|
|
|
|
if chunkList.trans(&item, runes) {
|
|
|
|
if chunkList.trans(&item, runes) {
|
|
|
|
|
|
|
|
mutex.Lock()
|
|
|
|
if result, _, _ := pattern.MatchItem(&item, false, slab); result != nil {
|
|
|
|
if result, _, _ := pattern.MatchItem(&item, false, slab); result != nil {
|
|
|
|
opts.Printer(item.text.ToString())
|
|
|
|
opts.Printer(item.text.ToString())
|
|
|
|
found = true
|
|
|
|
found = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex.Unlock()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false
|
|
|
|
return false
|
|
|
|
}, eventBox, opts.ReadZero, false)
|
|
|
|
}, eventBox, opts.ReadZero, false)
|
|
|
|