From 0e62dd479b959a67ecf4afc99140007796ac2a0b Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 18 Mar 2011 10:21:59 +1300 Subject: [PATCH] Do id-based comparison rather than value-based comparison to establish flow focus. This fixes a bug where focus would jump unpredictably between identical flows. --- libmproxy/console.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libmproxy/console.py b/libmproxy/console.py index 3320e2ca9..586fbfcf7 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -1028,7 +1028,8 @@ class ConsoleMaster(flow.FlowMaster): self.ui.clear() if self.currentflow: try: - idx = self.state.view.index(self.currentflow) + ids = [id(i) for i in self.state.view] + idx = ids.index(id(self.currentflow)) self.conn_list_view.set_focus(idx) except (IndexError, ValueError): pass