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

Comparing rxvt-unicode/src/perl/selection-autotransform (file contents):
Revision 1.11 by root, Sun Jun 10 17:31:53 2012 UTC vs.
Revision 1.15 by sf-exg, Thu Oct 30 09:44:58 2014 UTC

1#! perl 1#! perl
2 2
3#:META:X_RESOURCE:%.:string:autotransform expression 3#:META:RESOURCE:%.:string:autotransform expression
4 4
5=head1 NAME 5=head1 NAME
6 6
7 selection-autotransform - automatically transform select text 7selection-autotransform - automatically transform select text
8 8
9=head1 DESCRPIPTION 9=head1 DESCRIPTION
10 10
11This selection allows you to do automatic transforms on a selection 11This selection allows you to do automatic transforms on a selection
12whenever a selection is made. 12whenever a selection is made.
13 13
14It works by specifying perl snippets (most useful is a single C<s///> 14It works by specifying perl snippets (most useful is a single C<s///>
46sub msg { 46sub msg {
47 my ($self, $msg) = @_; 47 my ($self, $msg) = @_;
48 48
49 my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1); 49 my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1);
50 $overlay->set (0, 0, $msg); 50 $overlay->set (0, 0, $msg);
51 my $iow; $iow = urxvt::timer->new->after (2)->cb (sub { 51 $self->{timer} = urxvt::timer->new->after (2)->cb (sub {
52 delete $self->{timer};
52 undef $overlay; 53 undef $overlay;
53 undef $iow;
54 }); 54 });
55} 55}
56 56
57sub on_init { 57sub on_init {
58 my ($self) = @_; 58 my ($self) = @_;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines