From e4738bdd39c50f682f50eb16d996e8c35ebb053f Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 29 Mar 2015 14:39:47 +1300 Subject: [PATCH] Fix search wrap-around offsets. --- libmproxy/console/searchable.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libmproxy/console/searchable.py b/libmproxy/console/searchable.py index dc8b0bab9..5539ecb26 100644 --- a/libmproxy/console/searchable.py +++ b/libmproxy/console/searchable.py @@ -19,7 +19,6 @@ class Searchable(urwid.ListBox): self, urwid.SimpleFocusListWalker(contents) ) - self.search_offset = 0 self.current_highlight = None self.search_term = None @@ -68,7 +67,7 @@ class Searchable(urwid.ListBox): if backwards: rng = xrange(len(self.body)-1, -1, -1) else: - rng = xrange(1, len(self.body)) + rng = xrange(1, len(self.body) + 1) for i in rng: off = (self.focus_position + i)%len(self.body) w = self.body[off]