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) |
7 | selection - more intelligent selection (enabled by default) |
8 | |
8 | |
… | |
… | |
53 | |
53 | |
54 | =back |
54 | =back |
55 | |
55 | |
56 | =cut |
56 | =cut |
57 | |
57 | |
58 | sub on_user_command { |
58 | sub on_action { |
59 | my ($self, $cmd) = @_; |
59 | my ($self, $action) = @_; |
60 | |
60 | |
61 | $cmd eq "selection:rot13" |
61 | $action eq "rot13" |
62 | and $self->selection (map { y/A-Za-z/N-ZA-Mn-za-m/; $_ } $self->selection); |
62 | and $self->selection (map { y/A-Za-z/N-ZA-Mn-za-m/; $_ } $self->selection); |
63 | |
63 | |
64 | () |
64 | () |
65 | } |
|
|
66 | |
|
|
67 | sub on_keyboard_dispatch { |
|
|
68 | &on_user_command; |
|
|
69 | } |
65 | } |
70 | |
66 | |
71 | sub on_init { |
67 | sub on_init { |
72 | my ($self) = @_; |
68 | my ($self) = @_; |
73 | |
69 | |