X Tutup
Skip to content

Commit 7369114

Browse files
committed
Fixed bug in MatchesIterator.previous
1 parent 9a36c7a commit 7369114

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bpython/repl.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,10 @@ def next(self):
242242
return self.matches[self.index]
243243

244244
def previous(self):
245-
self.index = (self.index - 1) % len(self.matches)
245+
if self.index <= 0:
246+
self.index = len(self.matches)
247+
self.index -= 1
248+
246249
return self.matches[self.index]
247250

248251
def update(self, current_word='', matches=[]):

0 commit comments

Comments
 (0)
X Tutup