diff --git a/tabbedex b/tabbedex index 3d85e13..9ca58e2 100644 --- a/tabbedex +++ b/tabbedex @@ -3,7 +3,7 @@ ## TabbedEx plugin for rxvt-unicode ## Based on original tabbed plugin. ## Copyright (c) 2006-2012 tabbed authors -## Copyright (c) 2009-2013 tabbedex authors +## Copyright (c) 2009-2014 tabbedex authors ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -514,6 +514,10 @@ sub register_keysyms { $tab->parse_keysym('Shift-Up', 'perl:tabbedex:rename_tab'); $tab->parse_keysym('Control-Left', 'perl:tabbedex:move_tab_left'); $tab->parse_keysym('Control-Right', 'perl:tabbedex:move_tab_right'); + for my $num (1..12) { + $tab->parse_keysym('Meta-F' . $num, + 'perl:tabbedex:goto_tab_' . $num); + } } } @@ -726,6 +730,9 @@ sub tab_user_command { elsif ($cmd eq 'tabbedex:move_tab_right') { $self->move_tab($tab, 1); } + elsif ($cmd =~ /^tabbedex:goto_tab_(\d+)$/) { + $self->change_to_tab($tab, $1 - 1); + } elsif ($cmd eq 'tabbedex:rename_tab') { $self->rename_tab($tab); } @@ -755,6 +762,16 @@ sub change_tab { (); } +sub change_to_tab { + my ($self, $tab, $idx) = @_; + + if (!$self->{is_inputting_name} && @{ $self->{tabs} } > 1 && $idx >= 0 && $idx < @{ $self->{tabs} }) { + $self->make_current ($self->{tabs}[$idx]); + } + + (); +} + sub move_tab { my ($self, $tab, $direction) = @_;