Ensure queue_action is only called after the Tab object is fully initialized
Fix #103
This commit is contained in:
parent
ed50595aca
commit
9e512ff58a
@ -32,9 +32,12 @@ class Tab:
|
|||||||
self.borders = Borders(opts)
|
self.borders = Borders(opts)
|
||||||
self.windows = deque()
|
self.windows = deque()
|
||||||
self.active_window_idx = 0
|
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:
|
if session_tab is None:
|
||||||
self.cwd = args.directory
|
self.cwd = args.directory
|
||||||
l = self.enabled_layouts[0]
|
l = self.enabled_layouts[0]
|
||||||
|
self.current_layout = all_layouts[l](opts, self.borders.border_width, self.windows)
|
||||||
if special_window is None:
|
if special_window is None:
|
||||||
queue_action(self.new_window)
|
queue_action(self.new_window)
|
||||||
else:
|
else:
|
||||||
@ -42,10 +45,8 @@ class Tab:
|
|||||||
else:
|
else:
|
||||||
self.cwd = session_tab.cwd or args.directory
|
self.cwd = session_tab.cwd or args.directory
|
||||||
l = session_tab.layout
|
l = session_tab.layout
|
||||||
queue_action(self.startup, session_tab)
|
|
||||||
self.current_layout = all_layouts[l](opts, self.borders.border_width, self.windows)
|
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()):
|
queue_action(self.startup, session_tab)
|
||||||
setattr(self, which + '_window', partial(self.nth_window, num=i))
|
|
||||||
|
|
||||||
def startup(self, session_tab):
|
def startup(self, session_tab):
|
||||||
for cmd in session_tab.windows:
|
for cmd in session_tab.windows:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user