Fix enabled_layouts in session files not being respected
This commit is contained in:
parent
8f423c6d8f
commit
96d241e9f3
@ -59,6 +59,8 @@ class Session:
|
||||
|
||||
def set_enabled_layouts(self, raw):
|
||||
self.tabs[-1].enabled_layouts = to_layout_names(raw)
|
||||
if self.tabs[-1].layout not in self.tabs[-1].enabled_layouts:
|
||||
self.tabs[-1].layout = self.tabs[-1].enabled_layouts[0]
|
||||
|
||||
def set_cwd(self, val):
|
||||
self.tabs[-1].cwd = val
|
||||
|
||||
@ -107,12 +107,12 @@ class Tab: # {{{
|
||||
return all_layouts[idx](self.os_window_id, self.id, self.opts, self.borders.border_width)
|
||||
|
||||
def next_layout(self):
|
||||
if len(self.opts.enabled_layouts) > 1:
|
||||
if len(self.enabled_layouts) > 1:
|
||||
try:
|
||||
idx = self.opts.enabled_layouts.index(self.current_layout.name)
|
||||
idx = self.enabled_layouts.index(self.current_layout.name)
|
||||
except Exception:
|
||||
idx = -1
|
||||
nl = self.opts.enabled_layouts[(idx + 1) % len(self.opts.enabled_layouts)]
|
||||
nl = self.enabled_layouts[(idx + 1) % len(self.enabled_layouts)]
|
||||
self.current_layout = self.create_layout_object(nl)
|
||||
self.relayout()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user