diff options
| -rw-r--r-- | vimput.pl | 18 | 
1 files changed, 17 insertions, 1 deletions
| @@ -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));  }; | 
