summaryrefslogtreecommitdiff
path: root/src/matcher.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2025-07-06 22:02:12 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2025-07-06 22:02:12 +0900
commit82c9671f79c4673b0253db54533e6910f96a92a1 (patch)
treefac736ee0d72a8007db35662ddbaf6be3b6e259a /src/matcher.go
parentd364a1122e23149a6fb2e060fe5f7a0dbb752b20 (diff)
downloadfzf-82c9671f79c4673b0253db54533e6910f96a92a1.tar.gz
Fix selection lost on revision bump
Diffstat (limited to 'src/matcher.go')
-rw-r--r--src/matcher.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/matcher.go b/src/matcher.go
index 49d39730..daaa69ce 100644
--- a/src/matcher.go
+++ b/src/matcher.go
@@ -165,6 +165,7 @@ func (m *Matcher) scan(request MatchRequest) (*Merger, bool) {
}
minIndex := request.chunks[0].items[0].Index()
+ maxIndex := request.chunks[numChunks-1].lastIndex(minIndex)
cancelled := util.NewAtomicBool(false)
slices := m.sliceChunks(request.chunks)
@@ -236,7 +237,7 @@ func (m *Matcher) scan(request MatchRequest) (*Merger, bool) {
partialResult := <-resultChan
partialResults[partialResult.index] = partialResult.matches
}
- return NewMerger(pattern, partialResults, m.sort && request.pattern.sortable, m.tac, request.revision, minIndex), false
+ return NewMerger(pattern, partialResults, m.sort && request.pattern.sortable, m.tac, request.revision, minIndex, maxIndex), false
}
// Reset is called to interrupt/signal the ongoing search