Fix OnHistorySearch range+ error

Fix TypeError: unsupported operand type(s) for +: 'range' and 'range'
This commit is contained in:
komoto
2022-05-12 23:24:14 +09:00
parent 3e6be81d6d
commit efa85f1798
2 changed files with 4 additions and 4 deletions

View File

@@ -854,8 +854,8 @@ class Shell(editwindow.EditWindow):
or (self.historyIndex >= len(self.history)-2):
searchOrder = range(len(self.history))
else:
searchOrder = range(self.historyIndex+1, len(self.history)) + \
range(self.historyIndex)
ls = list(range(len(self.history)))
searchOrder = ls[self.historyIndex+1:] + ls[:self.historyIndex]
for i in searchOrder:
command = self.history[i]
if command[:len(searchText)] == searchText:

View File

@@ -2270,8 +2270,8 @@ class SlicesShell(editwindow.EditWindow):
or (self.historyIndex >= len(self.history)-2):
searchOrder = range(len(self.history))
else:
searchOrder = range(self.historyIndex+1, len(self.history)) + \
range(self.historyIndex)
ls = list(range(len(self.history)))
searchOrder = ls[self.historyIndex+1:] + ls[:self.historyIndex]
for i in searchOrder:
command = self.history[i]
if command[:len(searchText)] == searchText: