generating a patch from local changes (input checker)
sending the patch to the agent
applying patches that come in to the buffer (output checker)
@jamiboy16 's heartbeat check. periodically sends the contents of the buffer to the agent. The agent will respond with an ApplyText message if the CRDT and buffer document copies differ, and the plugin overwrites its the vim buffer with the document state in the CRDT.
In doing so, I added two semaphore/locks.
The first is a semaphore, used to halt the UI (self._ui). We do this so that when we are processing the buffer for input changes, no one writes to the buffer (reading & writing concurrently to vim.current.buffer causes a race condition, resulting in termination of the vim process).
The other is a lock (self._read_write_check), used to ensure that only one of the three threads (document synced, input checker, output checker) can be running at a time. This makes sure that
This diff adds:
ApplyText
message if the CRDT and buffer document copies differ, and the plugin overwrites its the vim buffer with the document state in the CRDT.In doing so, I added two semaphore/locks.
self._ui
). We do this so that when we are processing the buffer for input changes, no one writes to the buffer (reading & writing concurrently tovim.current.buffer
causes a race condition, resulting in termination of the vim process).self._read_write_check
), used to ensure that only one of the three threads (document synced, input checker, output checker) can be running at a time. This makes sure that