mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-23 13:43:00 +00:00
Move toggle_tab into Boss
actions arent supported on TabManager
This commit is contained in:
parent
76a4840a0f
commit
d33afd4e96
2 changed files with 16 additions and 11 deletions
|
|
@ -2930,3 +2930,19 @@ class Boss:
|
|||
|
||||
def on_system_color_scheme_change(self, appearance: int) -> None:
|
||||
log_error('system color theme changed:', appearance)
|
||||
|
||||
@ac('win', '''
|
||||
Toggle to the tab matching the specified expression
|
||||
|
||||
Switches to the matching tab if another tab is current, otherwise
|
||||
switches to the last used tab. Useful to easily switch to and back from a
|
||||
tab using a single shortcut. Note that toggling works only between
|
||||
tabs in the same OS window. See :ref:`search_syntax` for details
|
||||
on the match expression. For example::
|
||||
|
||||
map f1 toggle_tab title:mytab
|
||||
''')
|
||||
def toggle_tab(self, match_expression: str) -> None:
|
||||
tm = self.active_tab_manager
|
||||
if tm is not None:
|
||||
tm.toggle_tab(match_expression)
|
||||
|
|
|
|||
|
|
@ -990,17 +990,6 @@ class TabManager: # {{{
|
|||
if len(self.tabs) > 1:
|
||||
self.set_active_tab_idx((self.active_tab_idx + len(self.tabs) + delta) % len(self.tabs))
|
||||
|
||||
@ac('win', '''
|
||||
Toggle to the tab matching the specified expression
|
||||
|
||||
Switches to the matching tab if another tab is current, otherwise
|
||||
switches to the last used tab. Useful to easily switch to and back from a
|
||||
tab using a single shortcut. Note that toggling works only between
|
||||
tabs in the same OS window. See :ref:`search_syntax` for details
|
||||
on the match expression. For example::
|
||||
|
||||
map f1 toggle_tab title:mytab
|
||||
''')
|
||||
def toggle_tab(self, match_expression: str) -> None:
|
||||
tabs = set(get_boss().match_tabs(match_expression)) & set(self)
|
||||
if not tabs:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue