ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/tabbed
(Generate patch)

Comparing rxvt-unicode/src/perl/tabbed (file contents):
Revision 1.7 by root, Fri Jan 20 15:40:39 2006 UTC vs.
Revision 1.8 by root, Fri Jan 20 15:47:55 2006 UTC

208 } 208 }
209 209
210 () 210 ()
211} 211}
212 212
213sub 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
213package urxvt::ext::tabbed::tab; 232package 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 (\@_)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines