m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-17 15:53:39 -05:00

Handle int32 overflow

yes | fzf --tail=10 --preview 'echo "{n}"'
This commit is contained in:
Junegunn Choi
2024-06-05 09:47:05 +09:00
parent 93bbb3032d
commit ef148dfd37
2 changed files with 27 additions and 8 deletions

View File

@@ -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()