From 799c87767684880469c12d75053fb860f4a0d3c9 Mon Sep 17 00:00:00 2001 From: Pedro Worcel Date: Thu, 26 Dec 2013 22:18:34 +1300 Subject: now really fix it + test --- libmproxy/console/flowview.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'libmproxy/console/flowview.py') diff --git a/libmproxy/console/flowview.py b/libmproxy/console/flowview.py index b0931fa2..35fc1e43 100644 --- a/libmproxy/console/flowview.py +++ b/libmproxy/console/flowview.py @@ -323,21 +323,25 @@ class FlowView(common.WWrap): return "search hit BOTTOM, continuing at TOP" def search_get_start(self, search_string): + start_line = 0 + start_index = 0 last_search_string = self.state.get_flow_setting(self.flow, "last_search_string") if search_string == last_search_string: start_line = self.state.get_flow_setting(self.flow, "last_find_line") start_index = self.state.get_flow_setting(self.flow, "last_search_index") - if start_index != None: - start_index += len(search_string) - else: + if start_index == None: start_index = 0 + else: + start_index += len(search_string) + + if start_line == None: + start_line = 0 + else: self.state.add_flow_setting(self.flow, "last_search_string", search_string) - start_line = 0 - start_index = 0 return (start_line, start_index) -- cgit v1.2.3