Remove references to overlay_for from boss
This commit is contained in:
parent
81b28bc1bd
commit
79a780004f
@ -304,10 +304,9 @@ class Boss:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def active_window_for_cwd(self) -> Optional[Window]:
|
def active_window_for_cwd(self) -> Optional[Window]:
|
||||||
w = self.active_window
|
t = self.active_tab
|
||||||
if w is not None and w.overlay_for is not None and w.overlay_for in self.window_id_map:
|
if t is not None:
|
||||||
w = self.window_id_map[w.overlay_for]
|
return t.active_window_for_cwd
|
||||||
return w
|
|
||||||
|
|
||||||
def new_os_window_with_cwd(self, *args: str) -> None:
|
def new_os_window_with_cwd(self, *args: str) -> None:
|
||||||
w = self.active_window_for_cwd
|
w = self.active_window_for_cwd
|
||||||
@ -752,7 +751,7 @@ class Boss:
|
|||||||
|
|
||||||
def display_scrollback(self, window: Window, data: Optional[bytes], cmd: Optional[List[str]]) -> None:
|
def display_scrollback(self, window: Window, data: Optional[bytes], cmd: Optional[List[str]]) -> None:
|
||||||
tab = self.active_tab
|
tab = self.active_tab
|
||||||
if tab is not None and window.overlay_for is None:
|
if tab is not None:
|
||||||
tab.new_special_window(
|
tab.new_special_window(
|
||||||
SpecialWindow(cmd, data, _('History'), overlay_for=window.id),
|
SpecialWindow(cmd, data, _('History'), overlay_for=window.id),
|
||||||
copy_colors_from=self.active_window
|
copy_colors_from=self.active_window
|
||||||
@ -795,7 +794,7 @@ class Boss:
|
|||||||
if end_kitten.no_ui:
|
if end_kitten.no_ui:
|
||||||
return end_kitten(None, getattr(w, 'id', None), self)
|
return end_kitten(None, getattr(w, 'id', None), self)
|
||||||
|
|
||||||
if w is not None and tab is not None and w.overlay_for is None:
|
if w is not None and tab is not None:
|
||||||
args[0:0] = [config_dir, kitten]
|
args[0:0] = [config_dir, kitten]
|
||||||
if input_data is None:
|
if input_data is None:
|
||||||
type_of_input = end_kitten.type_of_input
|
type_of_input = end_kitten.type_of_input
|
||||||
@ -905,7 +904,7 @@ class Boss:
|
|||||||
elif window_type == 'overlay':
|
elif window_type == 'overlay':
|
||||||
w = self.active_window
|
w = self.active_window
|
||||||
tab = self.active_tab
|
tab = self.active_tab
|
||||||
if w is not None and tab is not None and w.overlay_for is None:
|
if w is not None and tab is not None:
|
||||||
tab.new_special_window(SpecialWindow(cmd, overlay_for=w.id))
|
tab.new_special_window(SpecialWindow(cmd, overlay_for=w.id))
|
||||||
else:
|
else:
|
||||||
self._new_window(cmd)
|
self._new_window(cmd)
|
||||||
@ -1047,7 +1046,7 @@ class Boss:
|
|||||||
continue
|
continue
|
||||||
arg = q
|
arg = q
|
||||||
cmdline.append(arg)
|
cmdline.append(arg)
|
||||||
overlay_for = w.id if w and as_overlay and w.overlay_for is None else None
|
overlay_for = w.id if w and as_overlay else None
|
||||||
return SpecialWindow(cmd, input_data, cwd_from=cwd_from, overlay_for=overlay_for, env=env)
|
return SpecialWindow(cmd, input_data, cwd_from=cwd_from, overlay_for=overlay_for, env=env)
|
||||||
|
|
||||||
def run_background_process(
|
def run_background_process(
|
||||||
|
|||||||
@ -167,6 +167,10 @@ class Tab: # {{{
|
|||||||
def active_window(self) -> Optional[Window]:
|
def active_window(self) -> Optional[Window]:
|
||||||
return self.windows.active_window
|
return self.windows.active_window
|
||||||
|
|
||||||
|
@property
|
||||||
|
def active_window_for_cwd(self) -> Optional[Window]:
|
||||||
|
return self.windows.active_group_base
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def title(self) -> str:
|
def title(self) -> str:
|
||||||
return cast(str, getattr(self.active_window, 'title', appname))
|
return cast(str, getattr(self.active_window, 'title', appname))
|
||||||
|
|||||||
@ -191,6 +191,14 @@ class WindowList:
|
|||||||
pass
|
pass
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def active_group_base(self) -> Optional[WindowType]:
|
||||||
|
try:
|
||||||
|
return self.id_map[self.groups[self.active_group_idx].base_window_id]
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
return None
|
||||||
|
|
||||||
def set_active_window_group_for(self, x: WindowOrId) -> None:
|
def set_active_window_group_for(self, x: WindowOrId) -> None:
|
||||||
q = self.id_map[x] if isinstance(x, int) else x
|
q = self.id_map[x] if isinstance(x, int) else x
|
||||||
for i, group in enumerate(self.groups):
|
for i, group in enumerate(self.groups):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user