… | |
… | |
208 | } |
208 | } |
209 | |
209 | |
210 | () |
210 | () |
211 | } |
211 | } |
212 | |
212 | |
|
|
213 | sub tab_key_press { |
|
|
214 | my ($self, $tab, $event, $keysym, $str) = @_; |
|
|
215 | |
|
|
216 | if ($event->{state} & urxvt::ShiftMask |
|
|
217 | && ($keysym == 0xff51 || $keysym == 0xff53)) { |
|
|
218 | my ($idx) = grep $self->{tabs}[$_] == $tab, 0 .. $#{ $self->{tabs} }; |
|
|
219 | |
|
|
220 | --$idx if $keysym == 0xff51; |
|
|
221 | ++$idx if $keysym == 0xff53; |
|
|
222 | |
|
|
223 | $self->make_current ($self->{tabs}[$idx % @{ $self->{tabs}}]); |
|
|
224 | $self->refresh; |
|
|
225 | |
|
|
226 | return 1; |
|
|
227 | } |
|
|
228 | |
|
|
229 | () |
|
|
230 | } |
|
|
231 | |
213 | package urxvt::ext::tabbed::tab; |
232 | package urxvt::ext::tabbed::tab; |
214 | |
233 | |
215 | # helper extension implementing the subwindows of a tabbed terminal. |
234 | # helper extension implementing the subwindows of a tabbed terminal. |
216 | # simply proxies all interesting calls back to the tabbed class. |
235 | # simply proxies all interesting calls back to the tabbed class. |
217 | |
236 | |
218 | { |
237 | { |
219 | for my $hook qw(start destroy) { |
238 | for my $hook qw(start destroy key_press) { |
220 | eval qq{ |
239 | eval qq{ |
221 | sub on_$hook { |
240 | sub on_$hook { |
222 | my \$parent = \$_[0]{term}{parent} |
241 | my \$parent = \$_[0]{term}{parent} |
223 | or return; |
242 | or return; |
224 | \$parent->tab_$hook (\@_) |
243 | \$parent->tab_$hook (\@_) |