Change length parameter of getDisplayStrings to endIdx

It's more natural to work with this way, as we will see later in this branch.
This commit is contained in:
Stefan Haller 2023-08-17 21:52:29 +02:00
parent 996e30e5d9
commit 061bfce835
17 changed files with 38 additions and 38 deletions

View file

@ -12,7 +12,7 @@ type ListContextTrait struct {
c *ContextCommon
list types.IList
getDisplayStrings func(startIdx int, length int) [][]string
getDisplayStrings func(startIdx int, endIdx int) [][]string
// Alignment for each column. If nil, the default is left alignment
getColumnAlignments func() []utils.Alignment
// Some contexts, like the commit context, will highlight the path from the selected commit
@ -59,7 +59,7 @@ func (self *ListContextTrait) FocusLine() {
func (self *ListContextTrait) refreshViewport() {
startIdx, length := self.GetViewTrait().ViewPortYBounds()
displayStrings := self.getDisplayStrings(startIdx, length)
displayStrings := self.getDisplayStrings(startIdx, startIdx+length)
content := utils.RenderDisplayStrings(displayStrings, nil)
self.GetViewTrait().SetViewPortContent(content)
}