From ef148dfd3765cd78ccdb1840c3e1d74735071ab4 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 5 Jun 2024 09:47:05 +0900 Subject: Handle int32 overflow yes | fzf --tail=10 --preview 'echo "{n}"' --- src/item.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/item.go') diff --git a/src/item.go b/src/item.go index cb778cb9..c07d7fff 100644 --- a/src/item.go +++ b/src/item.go @@ -1,6 +1,8 @@ package fzf import ( + "math" + "github.com/junegunn/fzf/src/util" ) @@ -17,7 +19,7 @@ func (item *Item) Index() int32 { return item.text.Index } -var minItem = Item{text: util.Chars{Index: -1}} +var minItem = Item{text: util.Chars{Index: math.MinInt32}} func (item *Item) TrimLength() uint16 { return item.text.TrimLength() -- cgit v1.2.3