typeintandem / tandem

Typing in Tandem. Decentralized, cross-editor, collaborative text-editing!
Apache License 2.0
698 stars 20 forks source link

ST3 Conform to Protocol - Handle WriteRequest message #68

Closed rageandqq closed 6 years ago

rageandqq commented 6 years ago

Handles the WriteRequest.

The output checker reads the write request, schedules it's handler on the main thread, and blocks on an event. The handler reads the write request (errors if it receives any other type of message), flushes any pending input buffer changes, sends an ack, and processes the ApplyPatches method. Then it sets the event so that the output checker can continue, and releases control of the main thread.

Tested communication across sublime and vim. Since sublime runs in a GUI, I couldn't test concurrent editing - will have to do this in person.

The first diff in this stack uses the read_only flag method, but the most current iteration is the preferred solution, since ideally user keystrokes will be queued and not dropped during processing.

rageandqq commented 6 years ago

Link issue: https://github.com/geoffxy/tandem/issues/54