aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-12-16 21:11:21 +0100
committerTeddy Wing2017-12-16 21:11:21 +0100
commit944625d9a600d1f70ce5026437856b7eb97b2074 (patch)
tree1d158deefd63d04e9f9e0e63a119dd2888b3dd6e
parent22203ce9b5b95d37d2221e67e9e1d045f7830740 (diff)
downloadirssi-vimput-944625d9a600d1f70ce5026437856b7eb97b2074.tar.bz2
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.
-rw-r--r--vimput.pl10
1 files 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