From e233ebd9b85217ed4661519fef2c258bd1b387ca Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 16 Dec 2017 22:04:55 +0100 Subject: Move child fork test to a subroutine Gives the test a name making it easier to read. --- vimput.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vimput.pl b/vimput.pl index ab63fad..94fe882 100644 --- a/vimput.pl +++ b/vimput.pl @@ -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) = @_; -- cgit v1.2.3