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

@@ -41,6 +41,13 @@ func (c *Chunk) IsFull() bool {
return c.count == chunkSize
}
func (c *Chunk) lastIndex(minValue int32) int32 {
if c.count == 0 {
return minValue
}
return c.items[c.count-1].Index() + 1 // Exclusive
}
func (cl *ChunkList) lastChunk() *Chunk {
return cl.chunks[len(cl.chunks)-1]
}