diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2023-12-26 23:40:20 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2023-12-26 23:42:14 +0900 |
commit | 519de7c833ae46db72538b3cb5d2a53e08be2d78 (patch) | |
tree | dc2ad75e743da90ebd61337a6d25b72823cb0132 /src | |
parent | 97ccef1a04ef8a3fcffcc6682765d651b86d0480 (diff) |
Fix unexpected result of --tiebreak=end
See https://github.com/junegunn/fzf/issues/3255#issuecomment-1869580320
Diffstat (limited to 'src')
-rw-r--r-- | src/result.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/result.go b/src/result.go index 1212cabe..d72de420 100644 --- a/src/result.go +++ b/src/result.go @@ -80,7 +80,7 @@ func buildResult(item *Item, offsets []Offset, score int) Result { if criterion == byBegin { val = util.AsUint16(minEnd - whitePrefixLen) } else { - val = util.AsUint16(math.MaxUint16 - math.MaxUint16*(maxEnd-whitePrefixLen)/int(item.TrimLength())) + val = util.AsUint16(math.MaxUint16 - math.MaxUint16*(maxEnd-whitePrefixLen)/int(item.TrimLength()+1)) } } } |