aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-12-17 01:00:48 +0100
committerTeddy Wing2017-12-17 01:00:48 +0100
commitc1144625d59dd269838974b63cec400ca1ac8eb8 (patch)
tree5309849fabd9ad03bb2562f50f7c0fcb31303e4d
parent6eb894c411ccaf473dd2b4bae961cfeb86aee5a6 (diff)
downloadirssi-vimput-c1144625d59dd269838974b63cec400ca1ac8eb8.tar.bz2
Turn the 'on key press' signal into a command
Turns out it's possible to make this a command instead of listening for a shortcut on key press. Now when you want to run Vimput, you can make your own binding instead of me forcing C-x: /bind ^X /vimput
-rw-r--r--vimput.pl13
1 files changed, 4 insertions, 9 deletions
diff --git a/vimput.pl b/vimput.pl
index 6bb78fe..b3f6b80 100644
--- a/vimput.pl
+++ b/vimput.pl
@@ -189,12 +189,7 @@ sub is_ok_message {
}
-# TODO: Find out if it's possible to do this is a command
-Irssi::signal_add_last 'gui key pressed' => sub {
- my ($key) = @_;
-
- if ($key eq CTRL_X) {
- write_input(Irssi::parse_special('$L', undef, 0));
- open_tmux_and_update_input_line_when_finished();
- }
-};
+Irssi::command_bind('vimput' => sub {
+ write_input(Irssi::parse_special('$L', undef, 0));
+ open_tmux_and_update_input_line_when_finished();
+});