Fix selection lost on revision bump

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

No files matched your search

+2 -2
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 {