From 827a83efbc178390ddd8aaa36d26bce593d0d58f Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sat, 20 Aug 2016 01:46:54 +0900 Subject: Remove Offset slice from Result struct --- src/core.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/core.go') 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} -- cgit v1.2.3