aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-12-15 22:00:50 +0100
committerTeddy Wing2017-12-15 22:01:35 +0100
commit68569622cdd6390ed19ae1fed540d3485b956871 (patch)
tree7be02185ed8843783469220a1217856f2c77fce0
parente26b8d26ebfe24cee1ef9f301d3f426ca510f035 (diff)
downloadirssi-vimput-68569622cdd6390ed19ae1fed540d3485b956871.tar.bz2
Write input contents on C-x
Instead of writing the input message to a file on every key press, only write when Ctrl-X is pressed. This will be our command for opening Vim.
-rw-r--r--vimput.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/vimput.pl b/vimput.pl
index 7cba39c..0c09d36 100644
--- a/vimput.pl
+++ b/vimput.pl
@@ -12,6 +12,9 @@ our %IRSSI = {
};
+use constant CTRL_X => 24;
+
+
# The location of the temporary file where prompt contents are written.
sub tempfile {
Irssi::get_irssi_dir() . '/VIMPUT_MSG';
@@ -31,5 +34,7 @@ sub write_input {
Irssi::signal_add_last 'gui key pressed' => sub {
my ($key) = @_;
- write_input(Irssi::parse_special('$L', undef, 0));
+ if ($key eq CTRL_X) {
+ write_input(Irssi::parse_special('$L', undef, 0));
+ }
};