A new mappable action select_window_in_tab to select a window in the current tab to switch to, by window title

Also when using the focus_visible_window action in a layout that shows
only a single window such as the stack layout, use this facility
automatically.
This commit is contained in:
Kovid Goyal
2021-10-14 09:15:22 +05:30
parent 3f1a0baa84
commit 533b0ed591
3 changed files with 38 additions and 10 deletions

View File

@@ -209,9 +209,9 @@ class WindowList:
def iter_all_layoutable_groups(self, only_visible: bool = False) -> Iterator[WindowGroup]:
return iter(g for g in self.groups if g.is_visible_in_layout) if only_visible else iter(self.groups)
def iter_visible_windows_with_number(self) -> Iterator[Tuple[int, WindowType]]:
def iter_windows_with_number(self, only_visible: bool = True) -> Iterator[Tuple[int, WindowType]]:
for i, g in enumerate(self.groups):
if g.is_visible_in_layout:
if not only_visible or g.is_visible_in_layout:
aw = g.active_window_id
for window in g:
if window.id == aw: