Yasuhiro Matsumoto wrote:

> When the job exit immediately, channel->ch_to_be_closed will be TRUE
> before channel_read even though the output buffer is filled enough to
> read. For example, following command doesn't output result of the job.
> 
> ---------
> function! Disp(ch, msg)
>     echom a:msg
> endfunction
> 
> function! PerlCheck()
>     let s:job = job_start("perl -cw ".expand("%"), { "callback" : 
> function("Disp") })
> endfunction
> ---------

I cannot reproduce the problem.  Does this only happen on MS-Windows
perhaps?

> Below is a patch to fix this. This change doesn't break any tests.
> 
> https://gist.github.com/130f41a825ec72ccddb55b189d11558f

It looks like the change in channel_wait() is a no-op.
So the essential thing is to ignore ch_to_be_closed in channel_read().
Can you explain how we would get there with ch_to_be_closed set while
there is still something to read?  It should only happen after reading
failed.

Hmm, is it because PeekNamedPipe() returns zero but there is still
something to read?

-- 
hundred-and-one symptoms of being an internet addict:
163. You go outside for the fresh air (at -30 degrees) but open the
     window first to hear new mail arrive.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui