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.
This commit is contained in:
Aldo Cortesi 2011-03-18 10:21:59 +13:00
parent 894d3cc62d
commit 0e62dd479b

View File

@ -1028,7 +1028,8 @@ class ConsoleMaster(flow.FlowMaster):
self.ui.clear() self.ui.clear()
if self.currentflow: if self.currentflow:
try: 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) self.conn_list_view.set_focus(idx)
except (IndexError, ValueError): except (IndexError, ValueError):
pass pass