Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
child_process_stream: split incoming chunks to reproduce bug
Browse files Browse the repository at this point in the history
  • Loading branch information
phodge committed Jul 3, 2018
1 parent 018b496 commit 38b0fb7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion nvim/child_process_stream.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,19 @@ function ChildProcessStream:read_start(cb)
if err then
error(err)
end
cb(chunk)

-- Send the chunks through <X> chars at a time. The read_start callback
-- should be happy to receive the data in chunks of any size as long as
-- they are in the correct order.
-- NOTE: sometimes this causes the functional tests to freeze up in weird
-- places, but also sometimes it causes a reproduction of the error seen on
-- OSX
local chunk_size = 8192
local i = 1
while i < #chunk do
cb(chunk:sub(i, i + chunk_size - 1))
i = i + chunk_size
end
end)
end

Expand Down

0 comments on commit 38b0fb7

Please sign in to comment.