Fix enabled_layouts in session files not being respected
This commit is contained in:
@@ -59,6 +59,8 @@ class Session:
|
|||||||
|
|
||||||
def set_enabled_layouts(self, raw):
|
def set_enabled_layouts(self, raw):
|
||||||
self.tabs[-1].enabled_layouts = to_layout_names(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):
|
def set_cwd(self, val):
|
||||||
self.tabs[-1].cwd = 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)
|
return all_layouts[idx](self.os_window_id, self.id, self.opts, self.borders.border_width)
|
||||||
|
|
||||||
def next_layout(self):
|
def next_layout(self):
|
||||||
if len(self.opts.enabled_layouts) > 1:
|
if len(self.enabled_layouts) > 1:
|
||||||
try:
|
try:
|
||||||
idx = self.opts.enabled_layouts.index(self.current_layout.name)
|
idx = self.enabled_layouts.index(self.current_layout.name)
|
||||||
except Exception:
|
except Exception:
|
||||||
idx = -1
|
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.current_layout = self.create_layout_object(nl)
|
||||||
self.relayout()
|
self.relayout()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user