Perl tabbedex: Ctrl+Shift+D destroys the tab.

This commit is contained in:
Kolan Sh 2013-02-21 17:39:05 +04:00
parent be7b3fdd49
commit 7830a3fbae
1 changed files with 13 additions and 6 deletions

View File

@ -51,7 +51,7 @@
## title is displayed). This make tab bar look nicer. ## title is displayed). This make tab bar look nicer.
## ##
## Added by StephenB: ## Added by StephenB:
## ##
## 7. Tabs can be named with Shift+Up (Enter to confirm, Escape to ## 7. Tabs can be named with Shift+Up (Enter to confirm, Escape to
## cancel). ## cancel).
## ##
@ -467,7 +467,7 @@ sub tab_key_press {
my ($self, $tab, $event, $keysym, $str) = @_; my ($self, $tab, $event, $keysym, $str) = @_;
# setting binding keys # setting binding keys
#open FILE, ">/tmp/key.txt" or die $!; #open FILE, ">/tmp/key.txt" or die $!;
#printf FILE $keysym; #printf FILE $keysym;
#close FILE; #close FILE;
@ -502,7 +502,7 @@ sub tab_key_press {
} }
# next tab # next tab
if ($keysym == 0x004b || $keysym == 0x006b) { elsif ($keysym == 0x004b || $keysym == 0x006b) {
if (@{ $self->{tabs} } > 1) { if (@{ $self->{tabs} } > 1) {
$self->change_tab($tab, 1); $self->change_tab($tab, 1);
} }
@ -511,7 +511,7 @@ sub tab_key_press {
# new tab # new tab
if ($keysym == 0x003b) { elsif ($keysym == 0x003b) {
$self->new_tab; $self->new_tab;
return 1; return 1;
@ -527,7 +527,7 @@ sub tab_key_press {
} }
# move tab left # move tab left
if ($keysym == 0x0048 || $keysym == 0x0068) { elsif ($keysym == 0x0048 || $keysym == 0x0068) {
if (@{ $self->{tabs} } > 1) { if (@{ $self->{tabs} } > 1) {
my $idx1 = 0; my $idx1 = 0;
++$idx1 while $self->{tabs}[$idx1] != $tab; ++$idx1 while $self->{tabs}[$idx1] != $tab;
@ -541,7 +541,7 @@ sub tab_key_press {
} }
# move tab right # move tab right
if ($keysym == 0x0047 || $keysym == 0x0067) { elsif ($keysym == 0x0047 || $keysym == 0x0067) {
if (@{ $self->{tabs} } > 1) { if (@{ $self->{tabs} } > 1) {
my $idx1 = 0; my $idx1 = 0;
++$idx1 while $self->{tabs}[$idx1] != $tab; ++$idx1 while $self->{tabs}[$idx1] != $tab;
@ -553,6 +553,13 @@ sub tab_key_press {
} }
return 1; return 1;
} }
# kill tab
elsif ($keysym == 0x0044) {
$tab->destroy;
return 1;
}
} }
(); ();