Skip to content

Commit a6c9964

Browse files
committed
Fix issue with long screens
My screen had more rows than the size of `lbls` so when I chose quick select on a full list of candidates, I got a traceback "IndexError: string index out of range." This only displays labels up to the number of labels and no more.
1 parent c676bac commit a6c9964

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/screenControl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,9 @@ def printXMode(self):
591591
topY = maxy - 2
592592
minY = self.scrollBar.getMinY() - 1
593593
for i in range(minY, topY + 1):
594-
self.colorPrinter.addstr(i, 1, lbls[i - minY])
594+
idx = i - minY
595+
if idx < len(lbls):
596+
self.colorPrinter.addstr(i, 1, lbls[idx])
595597

596598
def selectXMode(self, key):
597599
lineObj = self.lineObjs[

0 commit comments

Comments
 (0)