Add next/previous tab shortcuts

This commit is contained in:
Leroy Hopson 2021-07-13 22:48:02 +07:00
parent 97e07093b2
commit de7980c077
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
5 changed files with 41 additions and 0 deletions

View file

@ -193,6 +193,18 @@ func _input(event: InputEvent) -> void:
get_tree().set_input_as_handled()
_on_TerminalPopupMenu_id_pressed(TerminalPopupMenuOptions.PASTE)
# Next tab.
if _settings.next_tab_shortcut and _settings.next_tab_shortcut.shortcut:
if event.shortcut_match(_settings.next_tab_shortcut.shortcut):
get_tree().set_input_as_handled()
tabs.current_tab = min(tabs.current_tab + 1, tabs.get_tab_count() - 1)
# Previous tab.
if _settings.previous_tab_shortcut and _settings.previous_tab_shortcut.shortcut:
if event.shortcut_match(_settings.previous_tab_shortcut.shortcut):
get_tree().set_input_as_handled()
tabs.current_tab = max(tabs.current_tab - 1, 0)
func _on_TabContainer_gui_input(event):
if event is InputEventMouseButton and event.button_index == BUTTON_RIGHT: