Explicitly return None for negative event indices. Prior to this,

eventat(-1) would return the next-to-last event causing the back button
to cycle back to the end of an event source instead of stopping at the
start.
This commit is contained in:
John Baldwin 2014-09-30 17:19:07 +00:00
parent a6aedc5d49
commit c3db6aa680
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272315

View File

@ -856,7 +856,7 @@ def ysize(self):
return (Y_EVENTSOURCE)
def eventat(self, i):
if (i >= len(self.events)):
if (i >= len(self.events) or i < 0):
return (None)
event = self.events[i]
return (event)