Use marked property in ConsoleState.clear

This commit is contained in:
Shadab Zafar 2016-07-20 16:01:35 +05:30
parent 653ed4e342
commit 500b61a811

View File

@ -140,16 +140,12 @@ class ConsoleState(flow.State):
self.set_focus(0) self.set_focus(0)
def clear(self): def clear(self):
marked_flows = [] marked_flows = [f for f in self.state.view if f.marked]
for f in self.flows:
if self.flow_marked(f):
marked_flows.append(f)
super(ConsoleState, self).clear() super(ConsoleState, self).clear()
for f in marked_flows: for f in marked_flows:
self.add_flow(f) self.add_flow(f)
self.set_flow_marked(f, True) f.marked = True
if len(self.flows.views) == 0: if len(self.flows.views) == 0:
self.focus = None self.focus = None