aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vimput.pl18
1 files changed, 17 insertions, 1 deletions
diff --git a/vimput.pl b/vimput.pl
index 971616c..7cba39c 100644
--- a/vimput.pl
+++ b/vimput.pl
@@ -12,8 +12,24 @@ our %IRSSI = {
};
+# The location of the temporary file where prompt contents are written.
+sub tempfile {
+ Irssi::get_irssi_dir() . '/VIMPUT_MSG';
+}
+
+
+# Write the given string to our tempfile.
+sub write_input {
+ my ($message) = @_;
+
+ open my $handle, '>', tempfile or die $!;
+ print $handle $message;
+ close $handle;
+}
+
+
Irssi::signal_add_last 'gui key pressed' => sub {
my ($key) = @_;
- print Irssi::parse_special('$L', undef, 0);
+ write_input(Irssi::parse_special('$L', undef, 0));
};