Skip to content

Commit

Permalink
Propagate tab-swictch events if there is only one tab
Browse files Browse the repository at this point in the history
  • Loading branch information
blackm0re committed May 7, 2020
1 parent fe9e041 commit a7f5679
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions terminatorlib/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,20 @@ def on_keypress(self, widget, event):
# FIXME: Does keybindings really want to live in Terminator()?
mapping = self.terminator.keybindings.lookup(event)

# Just propagate tab-swictch events if there is only one tab
if (
mapping and (
mapping.startswith('switch_to_tab') or
mapping in ('next_tab', 'prev_tab')
)
):
window = self.get_toplevel()
child = window.get_children()[0]
if isinstance(child, Terminal):
# not a Notebook instance => a single tab is used
# .get_n_pages() can not be used
return(False)

if mapping == "hide_window":
return(False)

Expand Down

0 comments on commit a7f5679

Please sign in to comment.