From 8266b947104a0051e7f951d1f6c74d0e547b0e8d Mon Sep 17 00:00:00 2001 From: frelodev Date: Sat, 26 Oct 2024 21:55:23 +0200 Subject: [PATCH] fix: correctly ack messages and tryrecv again if failed to apply --- src/commands/buffers.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/commands/buffers.ts b/src/commands/buffers.ts index eac40ba..ab683dc 100644 --- a/src/commands/buffers.ts +++ b/src/commands/buffers.ts @@ -35,8 +35,10 @@ export async function apply_changes_to_buffer(path: string, controller: codemp.B editBuilder .replace(range, event.change.content) })) { - vscode.window.showWarningMessage("Couldn't apply changes"); - await resync(path, workspaceState.workspace, editor, 100); + continue; + } + else{ + controller.ack(event.version); } locks.delete(path); @@ -130,7 +132,7 @@ export async function attach_to_remote_buffer(buffer_name: string, set_content?: for (let change of event.contentChanges) { if (skip_this !== undefined && change.text == skip_this) continue; // LOGGER.info(`onDidChangeTextDocument(event: [${change.rangeOffset}, ${change.text}, ${change.rangeOffset + change.rangeLength}])`); - buffer.send({ + await buffer.send({ startIdx: change.rangeOffset, endIdx: change.rangeOffset + change.rangeLength, content: change.text