Ensure queue_action is only called after the Tab object is fully initialized

Fix #103
This commit is contained in:
Kovid Goyal 2017-08-04 07:52:25 +05:30
parent ed50595aca
commit 9e512ff58a
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -32,9 +32,12 @@ class Tab:
self.borders = Borders(opts)
self.windows = deque()
self.active_window_idx = 0
for i, which in enumerate('first second third fourth fifth sixth seventh eighth ninth tenth'.split()):
setattr(self, which + '_window', partial(self.nth_window, num=i))
if session_tab is None:
self.cwd = args.directory
l = self.enabled_layouts[0]
self.current_layout = all_layouts[l](opts, self.borders.border_width, self.windows)
if special_window is None:
queue_action(self.new_window)
else:
@ -42,10 +45,8 @@ class Tab:
else:
self.cwd = session_tab.cwd or args.directory
l = session_tab.layout
queue_action(self.startup, session_tab)
self.current_layout = all_layouts[l](opts, self.borders.border_width, self.windows)
for i, which in enumerate('first second third fourth fifth sixth seventh eighth ninth tenth'.split()):
setattr(self, which + '_window', partial(self.nth_window, num=i))
queue_action(self.startup, session_tab)
def startup(self, session_tab):
for cmd in session_tab.windows: