Add a couple more states to match against

So we can now select windows/tabs that are not active/focused but are in
the active/focused tab/os window.
This commit is contained in:
Kovid Goyal
2022-04-12 20:35:31 +05:30
parent f15ce21da1
commit 2c72c56e22
3 changed files with 12 additions and 2 deletions

View File

@@ -668,6 +668,10 @@ class Window:
return active_tab is not None and self is active_tab.active_window and current_os_window() == self.os_window_id
if query == 'needs_attention':
return self.needs_attention
if query == 'parent_active':
return active_tab is not None and self.tabref() is active_tab
if query == 'parent_focused':
return active_tab is not None and self.tabref() is active_tab and current_os_window() == self.os_window_id
return False
pat = compile_match_query(query, field != 'env')
return self.matches(field, pat)