From e9d6a741ecbfcfbde72c3d93212441fa0bc1e62b Mon Sep 17 00:00:00 2001 From: "Yong (Leo) Li" Date: Wed, 5 Jul 2023 13:53:12 +0000 Subject: [PATCH] fix list index out of range in forward search --- pyrepl/historical_reader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrepl/historical_reader.py b/pyrepl/historical_reader.py index 01522ee..7178596 100644 --- a/pyrepl/historical_reader.py +++ b/pyrepl/historical_reader.py @@ -275,7 +275,7 @@ def isearch_next(self): self.select_item(i) self.pos = p return - elif ((forwards and i == len(self.history) - 1) + elif ((forwards and i >= len(self.history) - 1) or (not forwards and i == 0)): self.error("not found") return