… | |
… | |
89 | |
89 | |
90 | Binds a popup menu to Ctrl-Button3 that lets you convert the selection |
90 | Binds a popup menu to Ctrl-Button3 that lets you convert the selection |
91 | text into various other formats/action (such as uri unescaping, perl |
91 | text into various other formats/action (such as uri unescaping, perl |
92 | evalution, web-browser starting etc.), depending on content. |
92 | evalution, web-browser starting etc.), depending on content. |
93 | |
93 | |
94 | Other extensions can extend this popup menu by pushing a code reference onto |
94 | Other extensions can extend this popup menu by pushing a code reference |
95 | C<@urxvt::ext::selection_popup::hook>, that is called whenever the popup is displayed. |
95 | onto C<@{ $term->{selection_popup_hook} }>, that is called whenever the |
|
|
96 | popup is displayed. |
96 | |
97 | |
97 | It's sole argument is the popup menu, which can be modified. The selection |
98 | It's sole argument is the popup menu, which can be modified. The selection |
98 | is in C<$_>, which can be used to decide wether to add something or not. |
99 | is in C<$_>, which can be used to decide wether to add something or not. |
99 | It should either return nothing or a string and a code reference. The |
100 | It should either return nothing or a string and a code reference. The |
100 | string will be used as button text and the code reference will be called |
101 | string will be used as button text and the code reference will be called |
… | |
… | |
102 | |
103 | |
103 | The following will add an entry C<a to b> that transforms all C<a>s in |
104 | The following will add an entry C<a to b> that transforms all C<a>s in |
104 | the selection to C<b>s, but only if the selection currently contains any |
105 | the selection to C<b>s, but only if the selection currently contains any |
105 | C<a>s: |
106 | C<a>s: |
106 | |
107 | |
107 | push urxvt::ext::selection_popup::hook, sub { |
108 | push @{ $self->{term}{selection_popup_hook} }, sub { |
108 | /a/ ? ("a to be" => sub { s/a/b/g } |
109 | /a/ ? ("a to be" => sub { s/a/b/g } |
109 | : () |
110 | : () |
110 | }; |
111 | }; |
111 | |
112 | |
112 | =item searchable-scrollback<hotkey> (enabled by default) |
113 | =item searchable-scrollback<hotkey> (enabled by default) |