From 944625d9a600d1f70ce5026437856b7eb97b2074 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 16 Dec 2017 21:11:21 +0100 Subject: Distinguish between commands and input in pipe reader Have a way to determine the difference between an input text and a message containing the temp file name. --- vimput.pl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vimput.pl b/vimput.pl index fd43bcd..4ab42ed 100644 --- a/vimput.pl +++ b/vimput.pl @@ -254,12 +254,12 @@ sub pipe_input { my $input = <$read_handle>; - # if (index($input, VIMPUT_IPC_COMMAND_PREFIX) == 0) { - # print substr $input, length(VIMPUT_IPC_COMMAND_PREFIX); - # } - # else { + if (index($input, VIMPUT_IPC_COMMAND_PREFIX) == 0) { + print substr $input, length(VIMPUT_IPC_COMMAND_PREFIX); + } + else { print 'I: ' . $input; - # } + } # TODO: Add $forked to not spawn more than one children unnecessarily -- cgit v1.2.3