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

Comparing rxvt-unicode/src/perl/selection-popup (file contents):
Revision 1.5 by root, Mon Jan 9 06:29:47 2006 UTC vs.
Revision 1.7 by root, Mon Jan 9 19:25:57 2006 UTC

1#! perl 1#! perl
2 2
3sub msg { 3sub msg {
4 my ($self, $msg1, $msg2) = @_; 4 my ($self, $msg) = @_;
5 5
6 my $overlay = $self->overlay (0, 0, 6 my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1);
7 (List::Util::max map $self->strwidth ($_), $msg1, $msg2), 2);
8 $overlay->set (0, 0, $msg1); 7 $overlay->set (0, 0, $msg);
9 $overlay->set (0, 1, $msg2);
10 my $iow; $iow = urxvt::timer->new->start (urxvt::NOW + 1)->cb (sub { 8 my $iow; $iow = urxvt::timer->new->start (urxvt::NOW + 1)->cb (sub {
11 undef $overlay; 9 undef $overlay;
12 undef $iow; 10 undef $iow;
13 }); 11 });
14} 12}
45 $cb->(); 43 $cb->();
46 44
47 if ($orig ne $_) { 45 if ($orig ne $_) {
48 $self->selection ($_); 46 $self->selection ($_);
49 s/[\x00-\x1f\x80-\x9f]/·/g; 47 s/[\x00-\x1f\x80-\x9f]/·/g;
50 $self->msg ("Selection replaced by", $_); 48 $self->msg ($self->special_encode ($_));
51 } 49 }
52 } 50 }
53 }); 51 });
54 }; 52 };
55 53
56 for ($text) { 54 for ($text) {
57 $add_button->("rot13" => sub { y/A-Za-z/N-ZA-Mn-za-m/ }); 55 $add_button->("rot13" => sub { y/A-Za-z/N-ZA-Mn-za-m/ });
58 56
59 urxvt::safe 57 urxvt::safe
60 and $add_button->("eval perl expression" => sub { $_ = eval urxvt::untaint $_ }); 58 and $add_button->("eval perl expression" => sub { no warnings; $_ = eval urxvt::untaint $_ });
61 59
62 /^(\S+):(\d+):?$/ 60 /^(\S+):(\d+):?$/
63 and $add_button->("vi-commands to load '$1'" => sub { s/^(\S+):(\d+):?$/\x1b:e $1\x0d:$2\x0d/ }); 61 and $add_button->("vi-commands to load '$1'" => sub { s/^(\S+):(\d+):?$/\x1b:e $1\x0d:$2\x0d/ });
64 62
65 /%[0-9a-fA-F]{2}/ && !/%[^0-9a-fA-F]/ && !/%.[^0-9a-fA-F]/ 63 /%[0-9a-fA-F]{2}/ && !/%[^0-9a-fA-F]/ && !/%.[^0-9a-fA-F]/

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines