> In both cases it's called from the end of WaitForCharOrMouse. > I'm not entirely sure I get all line numbers right, even when I compile vim > with -g -O0, so I had to go with the "Fprintf to stderr"-monkey style :). > > One further step in the stack trace: > ui_wait_for_chars_or_timer(...), the line "if (wait_func(due_time, > interrupted, ignore_input))". > Due_time is -1, interrupted 1 and ignore input 0. > > I guess it's the calls to has_pending_job() and > channel_any_readahead() that decides if there are more to read? But > wouldn't channel_any_readahead() require the message to have been > parsed to json before returning TRUE?
If the JSON is incomplete we need to receive more text to be able to parse it. Thus we might as well block on receiving something. > An example flow when it works: > Channel_read - 63 bytes > Channel_parse_messages > Channel_parse_json > Channel_parse_json > Channel_parse_json > RealWaitForChar (from mch_breakcheck, with 0 timeout) > > Then after a while: > Channel_read - 64 bytes > RealWaitForChar (from mch_breakcheck, with 0 timeout) So what is in those 64 bytes? If you look in the channel log it should be there. You don't quote from a channel log, did you use ch_logfile()? > RealWaitForChar (from mch_breakcheck, with 0 timeout) > RealWaitForChar (from mch_breakcheck, with 0 timeout) > RealWaitForChar (from mch_breakcheck, with 0 timeout) > RealWaitForChar (from ui_wait_for_chars_or_timer as wait_func.. with -1 > timeout) > // The select() call that hangs until keypressed > Channel_parse_messages > Channel_parse_json > Channel_parse_json > Channel_parse_json -- Two fish in a tank. One says to the other: "Do you know how to drive this thing?" /// 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201906250213.x5P2D8x7007291%40masaka.moolenaar.net. For more options, visit https://groups.google.com/d/optout.
