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

Comparing rxvt-unicode/src/perl/selection (file contents):
Revision 1.55 by root, Sun Jun 10 17:31:53 2012 UTC vs.
Revision 1.63 by root, Sat Jul 24 09:48:44 2021 UTC

1#! perl 1#! perl
2 2
3#:META:X_RESOURCE:%.pattern-0:string:first selection pattern 3#:META:RESOURCE:%.pattern-0:string:first selection pattern
4 4
5=head1 NAME 5=head1 NAME
6 6
7 selection - more intelligent selection (enabled by default) 7selection - more intelligent selection
8 8
9=head1 DESCRIPTION 9=head1 DESCRIPTION
10 10
11This extension tries to be more intelligent when the user extends 11This extension tries to be more intelligent when the user extends
12selections (double-click and further clicks). Right now, it tries to 12selections (double-click and further clicks). Right now, it tries to
39 URxvt.selection.pattern-0: ^(/[^:]+):\ 39 URxvt.selection.pattern-0: ^(/[^:]+):\
40 40
41You can look at the source of the selection extension to see more 41You can look at the source of the selection extension to see more
42interesting uses, such as parsing a line from beginning to end. 42interesting uses, such as parsing a line from beginning to end.
43 43
44This extension also offers following bindable keyboard commands: 44This extension also offers the following actions:
45 45
46=over 4 46=over
47 47
48=item rot13 48=item rot13
49 49
50Rot-13 the selection when activated. Used via keyboard trigger: 50Rot-13 the selection when activated.
51 51
52Example:
53
52 URxvt.keysym.C-M-r: perl:selection:rot13 54 URxvt.keysym.C-M-r: selection:rot13
53 55
54=back 56=back
55 57
56=cut 58=cut
57 59
58sub on_user_command { 60sub on_user_command {
59 my ($self, $cmd) = @_; 61 my ($self, $cmd) = @_;
60 62
61 $cmd eq "selection:rot13" 63 $cmd eq "selection:rot13"
64 and $self->selection (map { y/A-Za-z/N-ZA-Mn-za-m/; $_ } $self->selection);
65
66 ()
67}
68
69sub on_action {
70 my ($self, $action) = @_;
71
72 $action eq "rot13"
62 and $self->selection (map { y/A-Za-z/N-ZA-Mn-za-m/; $_ } $self->selection); 73 and $self->selection (map { y/A-Za-z/N-ZA-Mn-za-m/; $_ } $self->selection);
63 74
64 () 75 ()
65} 76}
66 77

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines