aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-12-16 22:04:55 +0100
committerTeddy Wing2017-12-16 22:04:55 +0100
commite233ebd9b85217ed4661519fef2c258bd1b387ca (patch)
treea9f773b06465291bd2bf796fa3336db417fc8f8b
parent54d96624637e432f11f58d1b22c6307cc4ea7fa3 (diff)
downloadirssi-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.pl9
1 files changed, 8 insertions, 1 deletions
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) = @_;