1
0
mirror of https://github.com/gryf/tabbedalt.git synced 2025-12-17 19:40:31 +01:00

Rename new_tab function to _new_tab

This commit is contained in:
2022-02-14 17:02:29 +01:00
parent 53f3b89e7c
commit 317af4fe06

View File

@@ -143,7 +143,7 @@ sub refresh {
if ($self->{new_button}) { if ($self->{new_button}) {
substr $text, 0, 7, "[NEW] |"; substr $text, 0, 7, "[NEW] |";
@$rend[0 .. 5] = ($self->{rs_tab}) x 6; @$rend[0 .. 5] = ($self->{rs_tab}) x 6;
push @ofs, [0, 6, sub { $_[0]->new_tab("shell") }]; push @ofs, [0, 6, sub { $_[0]->_new_tab("shell") }];
$ofs = 7; $ofs = 7;
} }
@@ -193,7 +193,7 @@ sub refresh {
$self->want_refresh; $self->want_refresh;
} }
sub new_tab { sub _new_tab {
my ($self, @argv) = @_; my ($self, @argv) = @_;
my $tab_name = shift @argv; my $tab_name = shift @argv;
@@ -465,17 +465,17 @@ sub on_start {
my @command; my @command;
for my $item (@{$self->{session}}){ for my $item (@{$self->{session}}){
if (exists($self->{tabcmds}{uc($item)})) { if (exists($self->{tabcmds}{uc($item)})) {
$self->new_tab(@{$self->{tabcmds}{uc($item)}}); $self->_new_tab(@{$self->{tabcmds}{uc($item)}});
$count++; $count++;
} }
} }
if ($count == 0) { if ($count == 0) {
# no keys was valid, failsafe shell. # no keys was valid, failsafe shell.
$self->new_tab ("shell", @argv); $self->_new_tab ("shell", @argv);
} }
} else { } else {
$self->new_tab ("shell", @argv); $self->_new_tab ("shell", @argv);
} }
if (defined $self->{timeouts}) { if (defined $self->{timeouts}) {
@@ -566,12 +566,12 @@ sub tab_key_press {
if ($event->{state} & urxvt::ControlMask) { if ($event->{state} & urxvt::ControlMask) {
if (exists($self->{tabcmds}{chr($keysym)})) { if (exists($self->{tabcmds}{chr($keysym)})) {
# Execute user defined classes of shell programs. # Execute user defined classes of shell programs.
$self->new_tab(@{$self->{tabcmds}{chr($keysym)}}); $self->_new_tab(@{$self->{tabcmds}{chr($keysym)}});
return 1; return 1;
} elsif ($self->{disable_shift_down} and $keysym == 0x4e) { } elsif ($self->{disable_shift_down} and $keysym == 0x4e) {
# As a failsafe watch under CTRL+SHIFT+N for shell class (if # As a failsafe watch under CTRL+SHIFT+N for shell class (if
# SHIFT+DOWN is disabled). # SHIFT+DOWN is disabled).
$self->new_tab("shell"); $self->_new_tab("shell");
return 1; return 1;
} }
} elsif ($keysym == 0xff51 || $keysym == 0xff53) { } elsif ($keysym == 0xff51 || $keysym == 0xff53) {
@@ -592,7 +592,7 @@ sub tab_key_press {
return 1; return 1;
} elsif (not $self->{disable_shift_down} and $keysym == 0xff54) { } elsif (not $self->{disable_shift_down} and $keysym == 0xff54) {
# Run shell on SHIFT+DOWN, if enabled. # Run shell on SHIFT+DOWN, if enabled.
$self->new_tab("shell"); $self->_new_tab("shell");
return 1; return 1;
} }
} }