diff options
| author | Teddy Wing | 2017-12-16 22:04:55 +0100 |
|---|---|---|
| committer | Teddy Wing | 2017-12-16 22:04:55 +0100 |
| commit | e233ebd9b85217ed4661519fef2c258bd1b387ca (patch) | |
| tree | a9f773b06465291bd2bf796fa3336db417fc8f8b | |
| parent | 54d96624637e432f11f58d1b22c6307cc4ea7fa3 (diff) | |
| download | irssi-vimput-e233ebd9b85217ed4661519fef2c258bd1b387ca.tar.bz2 | |
Move child fork test to a subroutine
Gives the test a name making it easier to read.
| -rw-r--r-- | vimput.pl | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -66,7 +66,7 @@ sub update_input_line_when_finished { return; } - if ($pid == 0) { + if (is_child_fork($pid)) { my $fifo_path = tmpnam(); open_tmux_split($fifo_path); @@ -119,6 +119,13 @@ sub pipe_input { } +sub is_child_fork { + my ($pid) = @_; + + return $pid == 0; +} + + # TODO: Find out if it's possible to do this is a command Irssi::signal_add_last 'gui key pressed' => sub { my ($key) = @_; |
