summaryrefslogtreecommitdiff
path: root/src/item.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2024-06-05 09:47:05 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2024-06-05 14:29:50 +0900
commitef148dfd3765cd78ccdb1840c3e1d74735071ab4 (patch)
treee24288337a37012b89e2c51b63a2b039c6e61ae8 /src/item.go
parent93bbb3032d1e7550dbabb2d450999cd434c60509 (diff)
downloadfzf-ef148dfd3765cd78ccdb1840c3e1d74735071ab4.tar.gz
Handle int32 overflow
yes | fzf --tail=10 --preview 'echo "{n}"'
Diffstat (limited to 'src/item.go')
-rw-r--r--src/item.go4
1 files changed, 3 insertions, 1 deletions
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()