From 31278bcc6895089c97fc5d038cd1dd99053c3764 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 10 Nov 2015 01:50:41 +0900 Subject: Fix compatibility issues with OR operator and inverse terms --- src/item.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/item.go') diff --git a/src/item.go b/src/item.go index f2f105ac..5ce25c71 100644 --- a/src/item.go +++ b/src/item.go @@ -63,6 +63,9 @@ func (item *Item) Rank(cache bool) Rank { matchlen += end - begin } } + if matchlen == 0 { + matchlen = math.MaxUint16 + } var tiebreak uint16 switch rankTiebreak { case byLength: -- cgit v1.2.3