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

Commit 38b0fb7

Browse files
committed
child_process_stream: split incoming chunks to reproduce bug
1 parent 018b496 commit 38b0fb7

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

nvim/child_process_stream.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,19 @@ function ChildProcessStream:read_start(cb)
4040
if err then
4141
error(err)
4242
end
43-
cb(chunk)
43+
44+
-- Send the chunks through <X> chars at a time. The read_start callback
45+
-- should be happy to receive the data in chunks of any size as long as
46+
-- they are in the correct order.
47+
-- NOTE: sometimes this causes the functional tests to freeze up in weird
48+
-- places, but also sometimes it causes a reproduction of the error seen on
49+
-- OSX
50+
local chunk_size = 8192
51+
local i = 1
52+
while i < #chunk do
53+
cb(chunk:sub(i, i + chunk_size - 1))
54+
i = i + chunk_size
55+
end
4456
end)
4557
end
4658

0 commit comments

Comments
 (0)