m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-15 23:03:47 -05:00

Fix selection lost on revision bump

This commit is contained in:
Junegunn Choi
2025-07-06 22:02:12 +09:00
parent d364a1122e
commit 82c9671f79
6 changed files with 56 additions and 11 deletions

View File

@@ -1680,12 +1680,12 @@ func (t *Terminal) UpdateList(merger *Merger) {
// Trimmed by --tail: filter selection by index
filtered := make(map[int32]selectedItem)
minIndex := merger.minIndex
maxIndex := minIndex + int32(merger.Length())
maxIndex := merger.maxIndex
for k, v := range t.selected {
var included bool
if maxIndex > minIndex {
included = k >= minIndex && k < maxIndex
} else { // int32 overflow [==> <==]
} else if maxIndex < minIndex { // int32 overflow [==> <==]
included = k >= minIndex || k < maxIndex
}
if included {