mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
Fix search wrap-around offsets.
This commit is contained in:
parent
8a0404ddf8
commit
e4738bdd39
@ -19,7 +19,6 @@ class Searchable(urwid.ListBox):
|
|||||||
self,
|
self,
|
||||||
urwid.SimpleFocusListWalker(contents)
|
urwid.SimpleFocusListWalker(contents)
|
||||||
)
|
)
|
||||||
|
|
||||||
self.search_offset = 0
|
self.search_offset = 0
|
||||||
self.current_highlight = None
|
self.current_highlight = None
|
||||||
self.search_term = None
|
self.search_term = None
|
||||||
@ -68,7 +67,7 @@ class Searchable(urwid.ListBox):
|
|||||||
if backwards:
|
if backwards:
|
||||||
rng = xrange(len(self.body)-1, -1, -1)
|
rng = xrange(len(self.body)-1, -1, -1)
|
||||||
else:
|
else:
|
||||||
rng = xrange(1, len(self.body))
|
rng = xrange(1, len(self.body) + 1)
|
||||||
for i in rng:
|
for i in rng:
|
||||||
off = (self.focus_position + i)%len(self.body)
|
off = (self.focus_position + i)%len(self.body)
|
||||||
w = self.body[off]
|
w = self.body[off]
|
||||||
|
Loading…
Reference in New Issue
Block a user