mirror of
https://github.com/hexedtech/codemp-vscode.git
synced 2024-11-22 15:34:49 +01:00
fix: correctly ack messages and tryrecv again if failed to apply
This commit is contained in:
parent
db4d71121d
commit
8266b94710
1 changed files with 5 additions and 3 deletions
|
@ -35,8 +35,10 @@ export async function apply_changes_to_buffer(path: string, controller: codemp.B
|
||||||
editBuilder
|
editBuilder
|
||||||
.replace(range, event.change.content)
|
.replace(range, event.change.content)
|
||||||
})) {
|
})) {
|
||||||
vscode.window.showWarningMessage("Couldn't apply changes");
|
continue;
|
||||||
await resync(path, workspaceState.workspace, editor, 100);
|
}
|
||||||
|
else{
|
||||||
|
controller.ack(event.version);
|
||||||
}
|
}
|
||||||
locks.delete(path);
|
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) {
|
for (let change of event.contentChanges) {
|
||||||
if (skip_this !== undefined && change.text == skip_this) continue;
|
if (skip_this !== undefined && change.text == skip_this) continue;
|
||||||
// LOGGER.info(`onDidChangeTextDocument(event: [${change.rangeOffset}, ${change.text}, ${change.rangeOffset + change.rangeLength}])`);
|
// LOGGER.info(`onDidChangeTextDocument(event: [${change.rangeOffset}, ${change.text}, ${change.rangeOffset + change.rangeLength}])`);
|
||||||
buffer.send({
|
await buffer.send({
|
||||||
startIdx: change.rangeOffset,
|
startIdx: change.rangeOffset,
|
||||||
endIdx: change.rangeOffset + change.rangeLength,
|
endIdx: change.rangeOffset + change.rangeLength,
|
||||||
content: change.text
|
content: change.text
|
||||||
|
|
Loading…
Reference in a new issue