diff options
| author | Teddy Wing | 2017-12-15 22:00:50 +0100 |
|---|---|---|
| committer | Teddy Wing | 2017-12-15 22:01:35 +0100 |
| commit | 68569622cdd6390ed19ae1fed540d3485b956871 (patch) | |
| tree | 7be02185ed8843783469220a1217856f2c77fce0 /vimput.pl | |
| parent | e26b8d26ebfe24cee1ef9f301d3f426ca510f035 (diff) | |
| download | irssi-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.
Diffstat (limited to 'vimput.pl')
| -rw-r--r-- | vimput.pl | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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)); + } }; |
