summaryrefslogtreecommitdiffstats
path: root/src/core.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2016-08-20 01:46:54 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2016-08-20 01:53:32 +0900
commit827a83efbc178390ddd8aaa36d26bce593d0d58f (patch)
treef8f7533acf360e3e143892249f9e1613375638a3 /src/core.go
parent3e888493866d42845f11c4d57fc8f093a6e28644 (diff)
Remove Offset slice from Result struct
Diffstat (limited to 'src/core.go')
-rw-r--r--src/core.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core.go b/src/core.go
index 290c0af0..78dddc02 100644
--- a/src/core.go
+++ b/src/core.go
@@ -161,9 +161,11 @@ func Run(opts *Options) {
reader := Reader{
func(runes []byte) bool {
item := chunkList.trans(runes, 0)
- if item != nil && pattern.MatchItem(item) != nil {
- fmt.Println(item.text.ToString())
- found = true
+ if item != nil {
+ if result, _ := pattern.MatchItem(item); result != nil {
+ fmt.Println(item.text.ToString())
+ found = true
+ }
}
return false
}, eventBox, opts.ReadZero}